What is the usage of enumerate() function in Python?
Last updated 3 years, 6 months ago | 1556 views 75 5
Python | enumerate() Function
The enumerate() function is used to iterate through the sequence and retrieve the index position and its corresponding value at the same time.
lst = ["A","B","C"]
print (list(enumerate(lst)))
#[(0, 'A'), (1, 'B'), (2, 'C')]