+ 3
for i in range(10):
//do this 10 times..
this is a basic for loop. range() is the range you want to run. in the case of 10 it runs 10 times. i is just a variable, could be anything. for p in range if you want. each time the loop runs, i becomes the number of the loop you are on.
for i in range(3):
print(i)
output:
0
1
2
range(3) runs the loop 3 times. from 0-2 (think index 0). so the first run, i is range 0.. next run, i is range 1. and so on.
for i in range(3,6):
print(i)
output:
3
4
5
the difference here is instead of starting at 0, we started at 3.
for loops don't have to use range. they can also look thru a list or various other things.
myList=["a","boat","c"]
for i in myList:
print(i)
output:
a
boat
c
In this use, i isn't the number or range. i is the items in the list. so each time the loop runs, i becomes the list item it is currently on



