0
HELPPPPP PLEASSEE
num = 7 if num > 3: print("3") if num < 5: print("5") if num <= 7: print("7") Why do I only get back 3 and not 3 and 7? Thanks
4 Antworten
+ 2
your code runs the first statement, and since it sees that 7 > 3, it continues and prints 3. The next if statement you ask, is not True, so, it wants to continue on through an else or elif statement. It does print 7 because it does not reach that point. You could change the indentation of the final if statement. I hope this helps!
0
Because of the indentation.
With your current indentation, all the if statements are nested.
0
Thank you it helped me a lot
0
Ok I’ll try it thanks