Skip to content

Instantly share code, notes, and snippets.

@Everfighting
Last active May 4, 2017 05:07
Show Gist options
  • Save Everfighting/88c66e9f496668dd06eadd28c4a9137c to your computer and use it in GitHub Desktop.
Save Everfighting/88c66e9f496668dd06eadd28c4a9137c to your computer and use it in GitHub Desktop.
enumerate起始位置参数
list1 = ["这", "是", "一个", "测试"]
for index, item in enumerate(list1, 1):
print index, item
#results
#1 这
#2 是
#3 一个
#4 测试
#修改了默认的起始位置
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment