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

Quiz: Python Loops · Question 11 of 13

What does this print? (code)

What does this print?

for n in [3, 5, 8, 9]:
    if n % 2 == 0:
        print("even found")
        break
else:
    print("no even number")
  1. A.even found
  2. B.no even number
  3. C.even found no even number
  4. D.Nothing
Answer & explanation

Correct answer: even found

break runs at 8, so the loop's else block is skipped.

Can you get the rest right without peeking?

Take the timed Quiz: Python Loops quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →