📜  枚举单词 python 代码示例

📅  最后修改于: 2022-03-11 14:46:02.199000             🧑  作者: Mango

代码示例2
iterable = ["a","b","c"] #for this iterable
iterable = "abc"    #or for this iterable result will be the same
enumerate(iterable, start=0)    #enumerates any iterable object (array here)
>>[(0, 'a'), (1, 'b'), (2, 'c')]

Parameters:
Iterable: any object that supports iteration
Start: the index value from which the counter is 
              to be started, by default it is 0