• 摘要视图
  • 目录视图

Problem 22 Names scores

Problem 22: Names scores

https://projecteuler.net/problem=22

Using names.txt (right click and ‘Save Link/Target As…’), a 46K text file containing[……]

>> 阅读全文…

enumerate遍历序列

遍历一个序列,且每一步都需要知道当前的索引值。

方法:使用enumerate()实现,如下

[python]seq = [‘a’,’b’,’c’,’d’]

#index是当期的索引,item = seq[index]
for index,item in enumerate(seq[……]

>> 阅读全文…