- 1

Practice "Code coach Age Groups" "Python for beginners"

Does anyone solve the Practice "Code coach Age Groups" "Python for beginners".? If any please post the correct code...

24th Jan 2022, 9:16 AM
Ali Jouni
4 ответов
+ 3
Ali Jouni Your code is approximately right but you didn't follow a proper indentation and also you missed to print "Senior" in 1st elif should be >= 12 because you already have <= 11 in if block You code should have indentation means elif should start from just below if like this: age = int(input()) # your code goes here if age >= 0 and age <= 11: print ("Child") elif age >= 12 and age <= 17: print ("Teen") elif age >= 18 and age <= 64: print ("Adult") else: print ("Senior")
24th Jan 2022, 9:39 AM
A͢J
A͢J - avatar
+ 2
Thanks for your help By the way regarding the 1st elif was misstyping
24th Jan 2022, 10:02 AM
Ali Jouni
+ 1
Don't ask for code, ask for solution so you need to show your attempts.
24th Jan 2022, 9:22 AM
A͢J
A͢J - avatar
0
age = int(input()) if age > 0 and age <= 11 : print("Child") elif age >= 11 and age <= 17 : print("Teen") elif age >= 18 and age <= 64 : print("Adult") this is my code , ans its not working
24th Jan 2022, 9:25 AM
Ali Jouni