names = ['old_driver', 'rain', ['oldboy', 'oldgirl'], 'jack', '珊珊', 'peiqi',
'Alex', 'black_girl', 1, 2, 3, 4, 2, 5, 6, 2]
for i,k in enumerate(names): #枚举可以快捷的打印出索引和对应的元素
print(i, k)
count = 0
names = ['old_driver', 'rain', ['oldboy', 'oldgirl'], 'jack', '珊珊', 'peiqi',
'Alex', 'black_girl', 1, 2, 3, 4, 2, 5, 6, 2]
for i in names:
print(count,i)
count += 1 #用计数法也可以打印索引和对应的元素