for eachNum in [0, 1, 2]: print(eachNum) #range()内建函数生成0 1 2... for eachNum in range(3): print(eachNum) foo = 'abc' for c in foo: print(c)
输出:
0
1
2
0
1
2
a
b
c
for eachNum in [0, 1, 2]: print(eachNum) #range()内建函数生成0 1 2... for eachNum in range(3): print(eachNum) foo = 'abc' for c in foo: print(c)
输出:
0
1
2
0
1
2
a
b
c