The enumerate() function is used to iterate through the sequence and retrieve the index position and it's corresponding value at the same time
enumerate(iterable, start=0)
start
is omitted, 0 is taken as start.for i,v in enumerate(['Python','Java','C++']): print(i,v) 0 Python 1 Java 2 C++
This article is contributed by Aditya. If you like dEexams.com and would like to contribute, you can write your article here or mail your article to admin@deexams.com . See your article appearing on the dEexams.com main page and help others to learn.