合并完再放入enumerate()不管用
L = ['Adam', 'Lisa', 'Bart', 'Paul']
m = range(1,5)
n = zip(m,L)
for index, name in enumerate(n):
print index, '-', name
结果:
0 - (1, 'Adam')
1 - (2, 'Lisa')
2 - (3, 'Bart')
3 - (4, 'Paul')
咋回事?
L = ['Adam', 'Lisa', 'Bart', 'Paul']
m = range(1,5)
n = zip(m,L)
for index, name in enumerate(n):
print index, '-', name
结果:
0 - (1, 'Adam')
1 - (2, 'Lisa')
2 - (3, 'Bart')
3 - (4, 'Paul')
咋回事?
2017-08-21
举报