0
Why is the ANSWER 5?
spam = 7 if spam > 5: print("five") if spam > 8: print("eight")
3 Answers
+ 7
Technically, the answer isn't "5" but "five" ;P
- Value of 'spam' is set to 7 at first line.
- Next line you have an enbranchment conditional statement: as 7 ( 'spam' value ) is greater than 5, the print("five") is esxecuted.
- Finally you have another conditional statement, but as 7 is not greater than 8, print("eight") isn't executed...
+ 1
Because 7 is more than 5 which is first condition and less than 8 which is last condition
0
becuse first if is true