code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

code

What is the output of this code? num = 7 if num > 3: print("3") if num < 5: print("5") if num ==7: print("7") Why not 7? 7=7 then it must also print 7

20th Feb 2018, 6:58 AM
Jordan
Jordan  - avatar
1 Answer
+ 3
I found answer by @Markus Kaleton: because the if statement for seven is inside the if statement for 5 which is not true and so it doesnt run
20th Feb 2018, 7:00 AM
Sad
Sad - avatar