0
could somebody explain to me how this has no out put
if 15 == 30: print ("number is 30") if 15 > 16: print ("number is greater than 16") if 15 == 15: print ("number is 15") print ("program ended")
2 odpowiedzi
+ 1
Well, it has some output.
Namely "program ended".
Nothing else is printed, because the first condition 15==30 is wrong. Therefore the if-block is not entered, neither are the nested ifs
If there would be no indent (no nested, but separate ifs), it would also print "number is 15"
+ 1
thanks heaps but worked that out right after i posted that lol its blindingly obvious to me now