Looping in Python
How to use the enumerate() function in Python
Published in
3 min readSep 18, 2020
Introduction
Let’s say that we have a list. We want to iterate over this list, printing out the index followed by the list element or value at that index. Let’s accomplish this using a for loop:
num_list= [42, 56, 39, 59, 99]for i in range(len(num_list)):
print(i…