Back to the lesson: Loops
Loop Repeats the Line
The exercise
A for loop repeats the lines that are indented under it. range(3) means "three times". The code below shows Hi three times. Change the text so the program shows Python three times.
Example output:
Python
Python
Python
Starter code
for n in range(3):
print("Hi")
Write the code in the browser and run it — no installation needed.