- 1
What is the output of this code? spam = 7 if spam > 5: print("five") if spam > 8: print("eight")
why is it five?
9 ответов
+ 2
It should be five, since the first statement evaluates to true and the second to false
+ 1
Huh
+ 1
5
0
Because spam (here declared 7) is greater than 5, first if loop evaluates to true and executes the print statement second if statement is false and hence the print statement is skipped.
0
oh OK thx
0
five
0
its 5
0
5
- 1
5