Skip to content

Latest commit

 

History

History
21 lines (17 loc) · 365 Bytes

47.md

File metadata and controls

21 lines (17 loc) · 365 Bytes
@author jackzhenguo
@desc 
@date 2019/3/4

47 枚举对象  

返回一个可以枚举的对象,该对象的next()方法将返回一个元组。

In [1]: s = ["a","b","c"]
    ...: for i ,v in enumerate(s,1):
    ...:     print(i,v)
    ...:
1 a
2 b
3 c
[上一个例子](46.md) [下一个例子](48.md)