0

age = int(input()) if(age == 0 and age <= 11): print('Child') elif(age >= 11 and age <= 17): print('Teen') elif(age > 17

Is anything wrong in this code

12th May 2022, 7:23 AM
Purple Phoenix 7
Purple Phoenix 7 - avatar
3 Respostas
+ 3
at the last part it lacks the ending parenthesis ")" , the colon ":" and the last statement so it should be like this age = int(input()) if(age == 0 and age <= 11): print('Child') elif(age >= 11 and age <= 17): print('Teen') elif(age > 17): print ("adult")
12th May 2022, 8:06 AM
Ma Rose Porras
Ma Rose Porras - avatar
+ 3
I think atlast you can keep else instead of elif like this age = int(input()) if(age == 0 and age <= 11): print('Child') elif(age >= 11 and age <= 19): print('Teen') else: Print("adult")
12th May 2022, 9:05 AM
UNKNOWN
+ 3
Also, you should change age == 0 on age >= 0, since your programme will print "Child" only when age is 0
12th May 2022, 9:44 AM
Alexus100
Alexus100 - avatar