Question: 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 if statments to the main function?
Main function: main must call ALL helper functions except drawsymbols
main:
The main function must call rankinput and suitinput to obtain respective inputs from the user and call drawtop, drawmid, and drawbot 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 drawtoprank:
print
printl rank
def suitinput:
suit input "Enter suit CDHS:
while suit!C or suitlD or suit H or suit :
if suit :
return Ju
elif suit D:
return u
elif suit H:
return u
elif suit S:
return Vu
else:
suit input Invalid try again:
return suit
def rankinput:
rank input Enter card rank A :
while intrank and intrank:
rank intrank
If rank :
return A
Elif rank :
return strrank
Else:
return strrank
rank inputInvalid try again
def drawmidnumouter, nummid, symbol:
drawsymbols numouter, symbol
drawsymbols nummid, symbol
drawsymbols numouter, symbol
def drawbotO:
print I rank
print I rank
print
def main:
rank rankinput
suit suitinput
if rank in :
drawmid
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
