I am making a simple Program which says Happy Birthday to people aged above 3, and says happy birthday young boy to people aged | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I am making a simple Program which says Happy Birthday to people aged above 3, and says happy birthday young boy to people aged

Can You Please Correct The Code For Me: #This is a Simple Program a=int(input("Kindly, Enter Your Age :")) b=print("Happy Birthday") c=print("Happy Birthday Young Boy") if a>3: print(b) if a<3: print(c)

10th Dec 2019, 8:27 AM
Salar Adeel
Salar Adeel - avatar
1 Answer
+ 3
Here a slightly reworked code: a=int(input("Kindly, Enter Your Age :")) b="Happy Birthday" c="Happy Birthday Young Boy" if a>3: print(b) if a<=3: print(c) I changed the if statement, also the way you prepared the 2 messages for output. Hope this helps
10th Dec 2019, 10:45 AM
Lothar
Lothar - avatar