0

Why is the ANSWER 5?

spam = 7 if spam > 5: print("five") if spam > 8: print("eight")

4th Mar 2017, 10:17 PM
Cpt JokrZ
Cpt JokrZ - avatar
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...
6th Mar 2017, 7:45 AM
visph
visph - avatar
+ 1
Because 7 is more than 5 which is first condition and less than 8 which is last condition
4th Mar 2017, 10:24 PM
Ivan G
Ivan G - avatar
0
becuse first if is true
4th Mar 2017, 10:28 PM
hosein shurabi
hosein shurabi - avatar