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)
输出:
012012abc