🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Python Loops: questions with answers

13 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. What does this print? (code)
  2. Q2. How many times does the body run? for i in range(2, 20, 3):
  3. Q3. What does this print? (code)
  4. Q4. What does this print? (code)
  5. Q5. When does the else block of a for loop run?
  6. Q6. What does this print? (code)
  7. Q7. What does this print? (code)
  8. Q8. What is list(range(5, 0, -2))?
  9. Q9. What does this print? (code)
  10. Q10. What does this print? (code)
  11. Q11. What does this print? (code)
  12. Q12. A program must keep asking for a password until the user types the right one. Which loop fits best?
  13. Q13. What does this print? (code)