0
why this if statements are no output 7?
num = 7 if num > 3: print("3") if num < 5: print("5") if num == 7: print("7") Output result is just only 3 but i think that num is same at 7 so output 3 and 7
2 Answers
0
Python uses indentation instead of curly braces.
https://www.sololearn.com/learn/Python/2277/?ref=app
(In yellow box below)
The if num == 7 is in if num < 5
And because num < 5 is false
num == 7 is not executed.
0
aha thx