1foo = ['foo', 'bar']
2for i in foo:
3 print(i) #outputs 'foo' then 'bar'
4for i in range(len(foo)):
5 print(foo[i]) #outputs 'foo' then 'bar'
6i = 0
7while i < len(foo):
8 print(foo[i]) #outputs 'foo' then 'bar'
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)