CBSE Class 10 Computer Applications Question 6 of 26

Python Conditionals and Loops — Question 4

Back to all questions
4
Question

Question 4

What is the output of following code ?

if None :
    print "Up"
else:   
    print "Down"
  1. Up
  2. Down
  3. No output
  4. Up Down
Answer

Down

Reason — Since None is treated as false, the if condition results in false. The block of if will be ignored and the else block will be executed and Down will be printed on the output screen.