10/13/2018

python, get index and value in for loop

Use 'enumerate'

for index, item in enumerate(values):
print(index, item)

No comments:

Post a Comment