29th Jan 2023, 2:46 PM
RocketLover
6 Answers
+ 4
Mark Russell See this again Age is missing... age = int(input()) if age>0 and age <=11: print("Child") elif age>=12 and age<=17: print("Teen") elif age>=18 and age<=64: print("Adult")
29th Jan 2023, 3:02 PM
Tนktนk💕
Tนktนk💕 - avatar
+ 1
There should be a valid expression after and, in your case and logic was followed immediately by <= operator Also, to make it easier, you can use the range function. For example, the conditional statements could be if age in range(0, 12): if age in range (12, 18): if age in range(18, 65):
29th Jan 2023, 3:11 PM
Mirielle
Mirielle - avatar
29th Jan 2023, 2:46 PM
RocketLover
0
Age groups
29th Jan 2023, 2:46 PM
RocketLover
0
In the condition statement add 'age' in the composite condition
31st Jan 2023, 9:22 AM
Teja Kiran
Teja Kiran - avatar
0
Nothing is wrong... it works ; )
31st Jan 2023, 9:36 AM
Benjamin Kalytta
Benjamin Kalytta - avatar