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

What does this print? (code)

What does this print?

print(sum(range(0, 11, 2)))
  1. A.55
  2. B.25
  3. C.30
  4. D.20
Answer & explanation

Correct answer: 30

range(0, 11, 2) gives 0, 2, 4, 6, 8, 10, and their sum is 30.

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 →