Answered step by step
Verified Expert Solution
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started