A for loop repeats code a specific number of times. The range() function generates a sequence of numbers:
range(n) produces numbers from 0 to n-1. You can also specify a start: range(1, 6) gives 1, 2, 3, 4, 5.
Bart Simpson had to write lines on the chalkboard during detention. Let's recreate that!
for i in range(5):
print(i)
# Output: 0, 1, 2, 3, 4
Run your code
I will not throw paper airplanes in class.
I will not throw paper airplanes in class.
I will not throw paper airplanes in class.
...