Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Check the errors on this code and add 9 if statments to the main function? Main function: main ( ) ( must call ALL helper

Check the errors on this code and add 9 if statments to the main function?
Main function: main ()(must call ALL helper functions except draw_symbols)
main():
The main function must call rank_input () and suit_input () to obtain respective inputs from the user and call draw_top, draw_mid, and draw_bot appropriately to draw the correct playing card using the information given. This function should not have any print statements at all.
Here is my code
def draw_top(rank):
print (""+7*"_")
print("l" rank)+6**+"|")
def suit_input():
suit = input( "Enter suit (C,D,H,S): ")
while( suit!="C" or suitl="D" or suit l="H" or suit "S"):
if suit ="C":
return "Ju2663"
elif suit ="D":
return "\u2666"
elif suit ="H":
return "\u2665"
elif suit ="S":
return "Vu2660"
else:
suit = input (" Invalid - try again: ")
return suit
def rank_input():
rank =(input(" Enter card rank (A -9): "))
while (int(rank)>0 and int(rank)10):
rank = int(rank)
If rank ==1 :
return "A"
Elif rank ==9:
return str(rank)
Else:
return str(rank)
rank = input("->Invalid - try again ")
def draw_mid(num_outer, num_mid, symbol):
draw_symbols ( num_outer, symbol )
draw_symbols( num_mid, symbol)
draw_symbols( num_outer, symbol )
def draw_botO:
print ("I"+6*""+ rank +"")
print ("I"+6*"++ rank +"")
print (""+7*"-")
def main():
rank = rank_input ()
suit = suit_input ()
if rank in '1aA':
draw_mid()
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

More Books

Students also viewed these Databases questions

Question

6. How will you provide encouragement and support?

Answered: 1 week ago

Question

3. Existing organizations and programs constrain behavior.

Answered: 1 week ago