Question: The following code has four errors. Please rewrite the code and fix the errors inside. All the errors are syntax related, so please don't change
The following code has four errors. Please rewrite the code and fix the errors inside. All the errors are syntax related, so please don't change any conditions or messages. def greetingCard(): name = input() age = input() if (age <= 12) message = "new toys" elif (age > 12) and (age <= 20): message = "friends" elif (age >= 21) and (age < 40): message = "time off" Else: message = "time to turn 40 again" print("Happy birthday " name , " Hope you get lots of ", message) ''' the following call the function above''' greetingCard() Sample runs Input 1: Alex 25 Output 1: Happy birthday Alex Hope you get lots of time off Input 2: John 12 Output 2: Happy birthday John Hope you get lots of new toys
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
