🌐
GeeksforGeeks
geeksforgeeks.org › python › enumerate-in-python
Enumerate() in Python - GeeksforGeeks
Explanation: list(enumerate(a)) converts index-element pairs into a list of tuples. Example 2: This code retrieves elements one by one using next() on enumerate object.
Published: May 8, 2026
🌐
Real Python
realpython.com › python-enumerate
Python enumerate(): Simplify Loops That Need Counters – Real Python
October 21, 2025 - >>> values = ["first", "second"] ... ~~~~^^^^^^^^^^^^^^^ StopIteration · In this example, you create a Python list called values with two elements, "first" and "second"....
Discussions

python - How to write a enumerate loop - Stack Overflow
Hopefully this clarifies what exactly enumerate does: >>> list(enumerate('abc')) [(0, 'a'), (1, 'b'), (2, 'c')] More on stackoverflow.com
🌐 stackoverflow.com
Python enumerate() function
Enumerate is a great function let’s take a look at it. def enumerate(iterator, start = 0): “Simplistic example” for item in iterator: yield start, item start += 1 What great about enumerate is it gives you the index value, of a list at the same time as the item. It also can be done for endless iterators. for index, value in enumerate([“hello”, “world”]): print(index, value) >>>0, hello >>>1, world More on reddit.com
🌐 r/pythontips
4
3
July 1, 2024
range(len(s)) vs enumerate?
Oldie but goodie: https://youtu.be/EnSu9hHGq5o Loop like a native: while, for, iterators, generators presented by Ned Batchelder More on reddit.com
🌐 r/learnpython
35
26
May 28, 2021
[deleted by user]
Thanks for the tutorial! More on reddit.com
🌐 r/learnpython
26
171
March 2, 2022
People also ask

What does enumerate() do in Python?
enumerate() adds a counter to an iterable, returning pairs of (index, value).
🌐
pythonbasics.org
pythonbasics.org › home › python basics › enumerate explained (with examples)
Enumerate Explained (With Examples) - pythonbasics.org
How do you use enumerate() in a for loop?
for i, val in enumerate(my_list): gives you both the index and value.
🌐
pythonbasics.org
pythonbasics.org › home › python basics › enumerate explained (with examples)
Enumerate Explained (With Examples) - pythonbasics.org
Can you start enumerate() from a number other than 0?
Yes: enumerate(my_list, start=1) starts counting from 1.
🌐
pythonbasics.org
pythonbasics.org › home › python basics › enumerate explained (with examples)
Enumerate Explained (With Examples) - pythonbasics.org
🌐
W3Schools
w3schools.com › python › ref_func_enumerate.asp
Python enumerate() Function
The enumerate() function adds a counter as the key of the enumerate object. ... Coding fundamentals as bite-sized lessons and challenges. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com · If you want to report an error, or if you want to make a suggestion, send us an e-mail: help@w3schools.com · HTML Tutorial CSS Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial
🌐
Python Basics
pythonbasics.org › home › python basics › enumerate explained (with examples)
Enumerate Explained (With Examples) - pythonbasics.org
... # create a sequence browsers = ['Chrome','Firefox','Opera','Vivaldi'] # create an enumeratable and convert to list x = list(enumerate(browsers)) print(x) ... browsers = ['Chrome','Firefox','Opera','Vivaldi'] eObj = enumerate(browsers) x = next(eObj) print(x) x = next(eObj) print(x) Let's ...
🌐
Programiz
programiz.com › python-programming › methods › built-in › enumerate
Python enumerate()
The enumerate() function adds a counter to an iterable and returns it as an enumerate object (iterator with index and the value). ... # enumerate the list enumerated_languages = enumerate(languages) # convert enumerate object to list print(list(enumerated_languages)) # Output: [(0, 'Python'), ...
🌐
Medium
medium.com › @datasciencejourney100_83560 › enumerate-function-in-py-1289137117e9
Enumerate Function in Python. The enumerate() function in Python is a… | by Rina Mondal | Medium
August 30, 2025 - ... # Syntax enumerate(iterable, start=0) # Example my_list = ['apple', 'banana', 'cherry'] for index, value in enumerate(my_list): print(index, value) # Output # 0 apple # 1 banana # 2 cherry
🌐
Python Tips
book.pythontips.com › en › latest › enumerate.html
13. Enumerate — Python Tips 0.1 documentation
my_list = ['apple', 'banana', 'grapes', 'pear'] for c, value in enumerate(my_list, 1): print(c, value) # Output: # 1 apple # 2 banana # 3 grapes # 4 pear · An example of where the optional argument of enumerate comes in handy is creating tuples containing the index and list item using a list.
Find elsewhere
🌐
Mimo
mimo.org › glossary › python › enumerate-function
Python enumerate Function: Master Index-Based Iteration
However, considering profiling different approaches if performance is critical in a tight loop with large data sets. ... # Example of enumerating with a large list large_list = list(range(1000000)) for i, val in enumerate(large_list): # Perform some operation pass
🌐
Great Learning
mygreatlearning.com › blog › it/software development › python enumerate(): simplify looping with counters
Python enumerate(): Simplify Looping With Counters
January 6, 2025 - You can use Python Enumerate Function to specify a different starting index value by adding the second parameter. my_list = ['apple,' 'banana,' 'cherry,' 'date'] for index, item in enumerate(my_list, start=1): print(index, item) The output will ...
🌐
Coursera
coursera.org › tutorials › how to enumerate in python: step by step
How to Enumerate in Python: Step by Step | Coursera
February 24, 2023 - You can use enumerate with any iterable object in Python. Examples of iterable objects include lists, strings, tuples, and dictionaries.
🌐
Guru99
guru99.com › home › python › python enumerate() function: loop, tuple & string
Enumerate() Function in Python: Loop, Tuple, String ...
July 10, 2026 - Enumerate method comes with an automatic counter/index to each of the items present in the Enumerate list in Python. The firstindex value will start from 0. You can also specify the startindex by using the optional parameter startIndex in enumerate. Example In the code below, mylist is the list given to Enumerate function in Python.
🌐
Tom's Hardware
tomshardware.com › software › programming › python
How to Enumerate in Python | Tom's Hardware
July 31, 2023 - 1. Create a list, collection or tuple. In this case we have three flavors in a list labeled as a variable named ‘flavors’. ... 2. Run the enumerate function. In the example code below, we’ve created a variable named ‘choices’ that ...
🌐
Simplilearn
simplilearn.com › home › resources › software development › an introduction to enumerate in python with syntax and examples
An Introduction to Enumerate in Python with Syntax and Examples
August 24, 2025 - Enumerate is a built-in function in the python library. This tutorial will help you to learn all about enumerate in python with syntax and examples. Start now!
Address: 5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
🌐
freeCodeCamp
freecodecamp.org › news › what-is-enumerate-in-python
What is enumerate() in Python? Enumeration Example
December 22, 2022 - The 1st element of names list and count = 0 forms the 1st tuple. The second element of the names list and count = 1 forms the second tuple. Similarly, the 4th element of the names list and count = 3 forms the last tuple.
🌐
ScholarHat
scholarhat.com › home › tutorials › python › the enumerate() function ..
The enumerate() Function in Python
September 11, 2025 - Python converts a data collection object into an enumerate object. An example of enumerate is when you list all of an author's works one by one
🌐
Codecademy
codecademy.com › docs › python › built-in functions › enumerate()
Python | Built-in Functions | enumerate() | Codecademy
April 14, 2025 - Learn the basics of Python 3.13, one of the most powerful, versatile, and in-demand programming languages today. ... Returns an enumerate object (iterator) containing tuples with the count (starting from the value of start) and values from the iterable. This example demonstrates how the enumerate() function is used on a list...
🌐
Afternerd
afternerd.com › blog › python-enumerate
Python Enumerate Explained (With Examples) - Afternerd
August 20, 2019 - So if you enumerate over a string, you will get back the index and value of each character in the string. ... str = "Python" for idx, ch in enumerate(str): print("index is %d and character is %s" \ % (idx, ch))
🌐
Medium
medium.com › pythoneers › master-pythons-enumerate-for-efficient-coding-3e14d5977e13
Master Python’s Enumerate Function | The Pythoneers
July 4, 2024 - In the second example, enumerate iterates over my_string, starting the index from 1, and prints each character along with its index. Hey there! I have also a list full of python articles to created just for Python enthusiasts click here or the image above to find out more!
🌐
Intellipaat
intellipaat.com › home › blog › enumerate() in python – a detailed explanation
Enumerate() in Python - A Detailed Explanation
March 26, 2025 - In Python, enumerate() is a built-in function that adds a counter as the key while iterating over a list or tuple, and keep both the index and value of each item in mind while doing so. It yields an iterator that produces pairs with the index and the corresponding item from the sequence, making it easier to access both simultaneously.