+ 5
In if statement 7==7 also true then that value also be printed... But it accepts only the first value.. Its wrong
6 Antworten
+ 22
it's because the third if is nested within the second one, which is false! so the third isn't even read
+ 5
Mind the indentation. Those are nested if.
What you say would be true if the program was:
num = 7;
if num > 3:
print("3")
if num < 5:
print("5")
if num==7:
print("7")
+ 1
It executed line by line so that last if should also be printed na
+ 1
agree with Julie. when you change the 5 to a 9 you get
3
9
7
Then all the statements are considered
0
In nested statement
num=3
if num<7:
print("1")
if num>5:
print("2")
if num<=3:
print ("3")
And is :1. why not 1&3.
0
i did't Understanding