Any one correct my Code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Any one correct my Code

age = input() if age >=12: print("You are child") else: print("You are not child")

21st Aug 2016, 10:28 AM
Rokon
7 Answers
+ 3
age = int(input("How old are you?: ")) if age <= 12: print("You are a child") else: print("You are not a child")
21st Aug 2016, 10:43 AM
Miguel
Miguel - avatar
+ 1
age = int(input()) if age >=12: print("You are child") else: print("You are not child") You have to cast your input to an integer
21st Aug 2016, 10:30 AM
Christian Hasenburg
Christian Hasenburg - avatar
+ 1
i've just edited my post. give it a just another try ;)
21st Aug 2016, 10:35 AM
Christian Hasenburg
Christian Hasenburg - avatar
0
Not working bro
21st Aug 2016, 10:33 AM
Rokon
0
age = int(input()) if age <=12: print("You are child") else if: age>=25: print("You are Young") how is that?
21st Aug 2016, 10:57 AM
Rokon
0
http://www.sololearn.com/app/JUMP_LINK__&&__python__&&__JUMP_LINK/playground/cS7gICykuRQv/ refer above code, i can see, your code is not properly indented, that is the only problem.
21st Aug 2016, 6:32 PM
Amit Gupta
Amit Gupta - avatar
0
age = int(input()) if age <=12: print("You are child") elif age >= 25: print("You are Young") try this....
24th Aug 2016, 3:23 AM
Amit Bhati
Amit Bhati - avatar