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

What does this print? (code)

What does this print?

for ch in "abc":
    print(ch * 2, end=" ")
  1. A.abcabc
  2. B.a b c a b c
  3. C.aa bb cc
  4. D.aabbcc
Answer & explanation

Correct answer: aa bb cc

The loop visits each letter, prints it twice, and end=" " puts a space instead of a new line.

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 →