Why this answer

Num=7 If num >3: Print(“3”) If num<5: Print (“5”) If num==7: Print (“7”) Why would the output of this be 3 instead of 7? Is it because it is also true and higher in the chain of if statements?

8/16/2019 6:36:42 PM

Sam Hatchard

1 Answer

New Answer


because it jumps out of the nesting of the if statements the moment it hits true. and because your num is bigger than 3 it simply says, okay, and prints “3”