All lessons

Loops

8 min · Python

Repeat work without writing it out a hundred times.

Python · Loops0/5 cleared

Enemy 1 of 5

A loop repeats code. A for loop with range(n) runs the indented block n times, counting from 0 up to n - 1.

Run this to print the numbers 0, 1, 2:

You
Pincer Crab

Loading editor...

Ln 1, Col 1Spaces: 4
Sign up to fightTarget output: 0 1 2