python记录贴

1、enumerate可添加list的indicies:

animals = ['cat', 'dog', 'monkey']
for idx, animal in enumerate(animals):
    print('#%d: %s' % (idx + 1, animal))
posted @ 2017-09-23 14:05  笨鸟不走  阅读(125)  评论(0编辑  收藏  举报