获取索引--------用range()和len()

a = ['Google', 'Baidu', 'Runoob', 'Taobao', 'QQ']

for i in range(len(a)):
print(i+1,a[i])
posted @ 2018-10-26 18:30  Jack的逆旅  阅读(363)  评论(0编辑  收藏  举报