0

im a beginner in python, can you help me in this code

i want to create a code which takes input from user about their age and outputs a statement, its working fine for the first 'if' age = input() if age >'30': print ('You are in 30+ family') if age < '30': print ('you are young')

3rd Dec 2021, 6:08 AM
Naveen
1 Réponse
+ 4
You put the second if statement inside the first one. So the second one will only be tested if the first one passes. Since they are opposites, if the first one passes the second one never will. Your fix is: indentation. Move the second if statement (and the print statement below it) back one tab's worth or however many spaces you use to indent.
3rd Dec 2021, 10:39 AM
Slick
Slick - avatar