Problem 22 Names scores
Problem 22: Names scores
Using names.txt (right click and ‘Save Link/Target As…’), a 46K text file containing[……]
Using names.txt (right click and ‘Save Link/Target As…’), a 46K text file containing[……]
遍历一个序列,且每一步都需要知道当前的索引值。
方法:使用enumerate()实现,如下
[python]seq = [‘a’,’b’,’c’,’d’]
#index是当期的索引,item = seq[index]
for index,item in enumerate(seq[……]