🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Python Conditions: all 13 questions

Quiz: Python Conditions · Question 6 of 13

What does this print? (code)

What does this print?

age = 17
print("adult" if age >= 18 else "minor")
  1. A.adult
  2. B.minor
  3. C.True
  4. D.An error
Answer & explanation

Correct answer: minor

The condition is false, so the else value is used.

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 →