← Quiz: Python Conditions: all 13 questions
Quiz: Python Conditions · Question 2 of 13
What does this print? (code)
What does this print?
n = 0
print("yes" if n else "no")
- A.yes
- B.no
- C.0
- D.Error
Answer & explanation
Correct answer: no
0 is falsy, so the else part runs.
Can you get the rest right without peeking?
Take the timed Quiz: Python Conditions quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →