1list = [1, 3, 5, 7, 9]
2
3# with index
4for index, item in enumerate(list):
5 print (item, " at index ", index)
6
7# without index
8for item in list:
9 print(item)
1lst = [10, 50, 75, 83, 98, 84, 32]
2
3for x in range(len(lst)):
4 print(lst[x])
5
1# Python list
2my_list = [1, 2, 3]
3
4# Python automatically create an item for you in the for loop
5for item in my_list:
6 print(item)
7
8
1thisList = [1, 2, 3, 4, 5, 6]
2
3x = 0
4while(x < len(thisList)):
5 print(thisList[x])
6 x += 1
7
8# or you can do this:
9
10for x in range(0, len(thisList)):
11 print(thisList[x])
12
13#or you can do this
14
15for x in thisList:
16 print(x)