Back to the lesson: Loops
Range Starts at One
The exercise
range(3) counts from 0: it gives 0, 1, 2. To choose where to start and where to stop, give range two numbers: range(start, stop). It stops BEFORE stop, so range(2, 5) gives 2, 3, 4. Change the code so it shows 1, 2, 3, each on its own line.
Example output:
1
2
3
Starter code
for n in range(3):
print(n)
Write the code in the browser and run it — no installation needed.