📜  list(my_enumerate(your_sequence)) == list(enumerate(your_sequence)) - Python 代码示例

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

代码示例1
my_list = ['apple', 'banana', 'grapes', 'pear']
counter_list = list(enumerate(my_list, 1))
print(counter_list)
# Output: [(1, 'apple'), (2, 'banana'), (3, 'grapes'), (4, 'pear')]