Python For Loop Quiz

  • Questions: 15
  • Easy
  • Pass mark: 70%

A for loop repeats the same steps for every item: every planet in a list, every second of a countdown, every letter in a word. This free quiz has 15 short questions that check you can predict how many times a loop runs and what it prints.

What the quiz covers

  • Looping over lists and strings
  • range() with a start, a stop and a step, including countdowns
  • Adding up and counting inside a loop
  • enumerate() and range(len()) when you need positions
  • Indentation inside the loop, break and a first nested loop

How it works

  • 15 questions: 11 with one correct answer, 4 where you select every correct answer
  • After each question you see the correct answer and a short explanation
  • No time limit and no account needed
  • Score 70% or more (11 of 15) to pass

Each topic has a runnable example: for loop basics, for loop with enumerate and range and break and continue. For loops inside loops, read nested loops in Python. After this one, try the Python If/Else Quiz or the Python Basics Quiz.

This quiz is for registered users. Log in to take it.

Log in

Log in to save this result to your progress. Log in

Next up: While Loop Basics →