The enumerate() function is used to iterate through the sequence and retrieve the index position and it's corresponding value at the same time
startis omitted, 0 is taken as start.
for i,v in enumerate(['Python','Java','C++']): print(i,v) 0 Python 1 Java 2 C++
Aditya on Jun 07, 2020 at 09:04 am
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 email@example.com . See your article appearing on the dEexams.com main page and help others to learn.