+ 2
What am I doing wrong?
age = int(input()) if age >0 and <=11: print("Child") else If age >=12 and <=17: print ("Teen") else If age >=18 and <=65: print ("Adult")
6 Answers
+ 5
Hi Faria!
Actually, the above answer is correct. But, the problem is that he used else if instead of elif.
It's the valid syntax for other languages but not for Python.
Python syntax:
if condition:
print()
elif condition:
print()
else:
print()
+ 4
You're not using loops in an appropriate way.
+ 3
You have to put the make the "i" in if command lowercase
and you must put "age" after and
age = int(input())
if age>0 and age<=11:
print("Child")
elif age>=12 and age<=17:
print ("Teen")
elif age>=18 and age<=65:
print ("Adult")
# Good Luck :)
+ 2
^
It's saying invalid syntax
+ 2
Oh I see. Thanks!!