Enumerate in Python

Enumerate is used in Python when we want to get the index of an element along with the element. For ex: a = [5, 6, 7, 8]for i, item in enumerate(a):    print(i, a) The output will be: 0 51 62 73 8  

Read more...