🎙 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 7 of 13

What does this print? (code)

What does this print?

for i in range(5):
    if i == 2:
        continue
    if i == 4:
        break
    print(i, end="")
  1. A.01234
  2. B.013
  3. C.0134
  4. D.01
Answer & explanation

Correct answer: 013

2 is skipped; the loop stops at 4.

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 →