3.1.2 Counting with range(stop)

Unit: Unit 3: Loops • Interactive Practice

Quick Answer & Summary:

Interactive Python programming tutorial and practice in your browser.

Interactive Challenge (Run Live in Browser):

# Repeat an action exactly 5 times using range(5)
for i in range(5):
    print("Iteration number:", i)

print("Counting complete!")
Open in Live Interactive Python Sandbox →