Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Step: 3

blur-text-image

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

Contemporary Issues In Database Design And Information Systems Development

Authors: Keng Siau

1st Edition

1599042894, 978-1599042893

More Books

Students also viewed these Databases questions