Nesting if statements in python -
so getting invalid syntax error when trying run little guy,
age = input("please tell me age?: ") age_test = eval(age) if age_test < 1: print("you can't negative!") if age_test > 100: print("you can't on 100!") else:
can me out here? i'm not new programming new python , don't see wrong.
indentation in python works how curly braces in other languages work. 4 spaces signals compiler block indented, , code nesting each conditional statement within 1 another, rather doing think intended, have them assessed 1 after another.
unindent conditionals same line initial if statement , go there.
Comments
Post a Comment