This question already has answers here:
Accessing the index in for loops
(26 answers)
Closed 9 months ago.
我可以发誓,我已经看到了一个函数(或方法),它接受一个列表,比如[3,7,19]
,并将其变成元组的可迭代列表,比如:[(0,3),(1,7),(2,19)]
for i in range(len(name_of_list)):
name_of_list[i] = something
但我记不起名字了,在谷歌上搜索“迭代列表”也一无所获。