I found it hard to understand first as well
My definition of a for loop where it's
Here's an example
My definition of a for loop where it's
for a in array
the for loop will go through every object in array
and each time, the object can be identified as a
.Here's an example
array = ['start', 1, 3, 2, 'finish'] for item in array: print(item)
Output:start
1
3
2
finish
array = range(1, 26) #Returns all the number 1-25 (It doesn't include the 26) for number in array: print(number)
Output:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
I hope this helps