a=[] for i in range(10): a.append(i) for i,j in zip(a[:-1],a[1:]): print('%s=>%s'%(i,j)) 输出结果:
0=>1
1=>2
2=>3
3=>4
4=>5
5=>6
6=>7
7=>8
8=>9