28th Jun 2021, 12:40 PM
Olwethu Shezi
Olwethu Shezi - avatar
3 Réponses
+ 3
You need to learn about Indentation in Python. Next some logic is misleading.. it won't work for all ages as you using if condition not satisfy... Use 'elif' instead of 'else if' for more clarity... Hope you can try these modifications after knowing Indentation .. edit: May you trying like this : after adding proper Indentation, it works for all cases... corrected code Olwethu Shezi age=int(input()) if age <= 19: if age >= 13: print("You are a teenager!") else: if age <= 13: print ("You are a kid!") else: print("You are an adult!")
28th Jun 2021, 12:51 PM
Jayakrishna 🇮🇳
+ 3
Please recap if-lessons. Indents are missing or wrong as well as :
28th Jun 2021, 12:51 PM
Oma Falk
Oma Falk - avatar
+ 1
https://code.sololearn.com/c7ZzUnVj4DI7/?ref=app 🌸Thank you. My code is fixed🌸
28th Jun 2021, 3:40 PM
Olwethu Shezi
Olwethu Shezi - avatar