CODEQUEST PYTHON ACADEMY
Python Loops Explained with Fun Examples
Loops help a program repeat a useful action without making a child write the same line again and again. They are one of the first ways Python starts to feel powerful and playful.
Practice Loops in CodeQuest →A loop repeats a plan
A for loop can visit each item in a small collection or repeat an action for a set of turns. Instead of writing print("Go!") five times, a loop can handle the repetition while the learner focuses on the pattern.
Ranges make counting clear
range(3) gives a loop three turns with counting values 0, 1, and 2. Ask a child to predict the output before running it, then change the range and describe what changed.
Indentation shows what repeats
Python uses indentation to show which lines belong inside a loop. The indented lines run each time; a line that moves back to the left waits until the loop is finished. This makes spacing part of the program’s meaning.
Build a tiny repeatable game
Try a countdown, a points counter, or a set of friendly messages. CodeQuest introduces loops through short experiments and challenges so children can see repetition, change one detail, and run the program again.
Keep exploring CodeQuest
Compare this learning path with related guides for families and beginners.