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

What does this print? (code)

What does this print?

for i in range(3):
    print(i, end=" ")
  1. A.1 2 3
  2. B.0 1 2
  3. C.0 1 2 3
  4. D.3
Answer & explanation

Correct answer: 0 1 2

range(3) starts at 0 and stops before 3.

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 →