🌐
GeeksforGeeks
geeksforgeeks.org › python › enumerate-in-python
Enumerate() in Python - GeeksforGeeks
It returns pairs in the form (index, element). This removes the need to manually maintain a counter variable during iteration. Example: This code shows how enumerate() provides both index and value while iterating over a list.
Published: May 8, 2026
🌐
Real Python
realpython.com › python-enumerate
Python enumerate(): Simplify Loops That Need Counters – Real Python
June 23, 2025 - Python’s enumerate() function adds a counter to an iterable and returns it in the form of an enumerate object, which can be used directly in loops. For example, when you want to display the winners of a race, you might write:
Discussions

Use cases for enumerate function?
I use it everywhere when i need the element position. You could use a count variable, but that's two more lines of (unnecessary) code. More on reddit.com
🌐 r/learnpython
7
1
June 19, 2020
[deleted by user]
Thanks for the tutorial! More on reddit.com
🌐 r/learnpython
26
171
March 2, 2022
Enumerate()
In short: enumerate adds a counter to an iterable and you can give an optional parameter (default: 0) where to start to count. Example: letters = ['a', 'b', 'c', 'd', 'e', 'f'] for counter, item in enumerate(letters, start=3): print(counter, item) output: (3, 'a') (4, 'b') (5, 'c') (6, 'd') (7, 'e') (8, 'f') More on reddit.com
🌐 r/learnpython
17
15
November 21, 2018
Hello, a complete novice to python. Can someone explain why to enumerate returns the memory address and the enumerated object?
Because you’re printing the object that you created. You need to iterate through it. From the docs Return an enumerate object Python Docs -Enumerate More on reddit.com
🌐 r/learnpython
6
1
November 21, 2022
People also ask

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
🌐
Python Basics
pythonbasics.org › home › python basics › enumerate explained (with examples)
Enumerate Explained (With Examples) - pythonbasics.org
You can enumerate a Python tuple, which isn't very different from iterating over a list. The code below shows you how to iterate over a tuple: ... >>> fruits = [(15,"Fifteen"), (12,"Twelve"), (19,"Nineteen")] >>> for i,j in enumerate(fruits): ... print(i,j) ...
🌐
Programiz
programiz.com › python-programming › methods › built-in › enumerate
Python enumerate() | Programiz
February 20, 2024 - # change the default counter and loop for count, item in enumerate(grocery, 100): print(count, item) ... To learn more about loops, visit Python for loop.
🌐
W3Schools
w3schools.com › python › ref_func_enumerate.asp
Python enumerate() Function
The enumerate() function takes a collection (e.g. a tuple) and returns it as an enumerate object.
🌐
freeCodeCamp
freecodecamp.org › news › what-is-enumerate-in-python
What is enumerate() in Python? Enumeration Example
December 22, 2022 - You'll want to use this option when you have a requirement that the index values must start from some specific value. For example, for this student name list: ... We want a list of student IDs and names with the restriction that the IDs must start from 1. In that case, we can invoke enumerate with a start parameter like this:
🌐
Coursera
coursera.org › tutorials › how to enumerate in python: step by step
How to Enumerate in Python: Step by Step | Coursera
February 24, 2023 - Python enumerate assigns a count to each item within an iterable and returns it as an enumerate object. This function enables you to loop over an iterable while accessing the index of items within it.
Find elsewhere
🌐
Mimo
mimo.org › glossary › python › enumerate-function
Python enumerate(): Loop with an Index and start=
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 ...
🌐
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:
🌐
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.
🌐
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
🌐
GeeksforGeeks
geeksforgeeks.org › enumerate-in-python
Enumerate() in Python - GeeksforGeeks
a = ["Geeks", "for", "Geeks"] # printing the tuples in object directly for ele in enumerate(a): print (ele) ... In Python, the enumerate() function serves as an iterator, inheriting all associated iterator functions and methods.
Published: January 20, 2025
🌐
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 Guides
pythonguides.com › enumerate-in-python
What Does enumerate() Do in Python? (With Examples)
1 month ago - for i, park in enumerate(["Yellowstone", "Zion"]): print(i, park) # 0 Yellowstone, then 1 Zion · All the output below is copied from Python 3.12.5 on Windows, and the screenshots show the same runs in Command Prompt.
🌐
Real Python
realpython.com › ref › builtin-functions › enumerate
enumerate() | Python’s Built-in Functions – Real Python
>>> letters = ["a", "b", "c"] >>> for index, letter in enumerate(letters): ... print(index, letter) ...
🌐
Great Learning
mygreatlearning.com › blog › it/software development › python enumerate(): simplify looping with counters
Python enumerate(): Simplify Looping With Counters
January 6, 2025 - The simplest and most common way ... below: ... In this example, the index represents the current index of the iterable object, and the value represents the current value of the iterable object....
🌐
DataCamp
datacamp.com › home › tutorials › python › python enumerate tutorial
Python Enumerate Tutorial | DataCamp
May 20, 2022 - The enumerate() function is a Python built-in function that takes an iterable (a collection of items or any other Python object that supports iteration, such as tuples, lists, sets, or strings), iterates through its items under the hood, and returns an enumerate object.
🌐
freeCodeCamp
freecodecamp.org › news › python-enumerate-what-is-the-enumerate-function-in-python
Python enumerate() – What is the Enumerate Function in Python?
June 8, 2022 - The enumerate() function in Python takes in a data collection as a parameter and returns an enumerate object. The enumerate object is returned in a key-value pair format. The key is the corresponding index of each item and the value is the items. In this article, we'll see some examples of how to use the enumerate() function in Python.
🌐
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))
🌐
ScholarHat
scholarhat.com › home › tutorials › python › the enumerate() function ..
The enumerate() Function in Python
September 11, 2025 - You'll call enumerate() inside the loop. You may now work with the current item and its index inside the loop by using the value and index variables. Python sets are unordered collections of data. The items inside them are immutable and thus, cannot be changed after they are included. Let's see all the implementations with its example...