🌐
GeeksforGeeks
geeksforgeeks.org › python › enumerate-in-python
Enumerate() in Python - GeeksforGeeks
The enumerate() function in Python is used to iterate over an iterable while keeping track of both the index and the value. It returns pairs in the form (index, element).
Published: May 8, 2026
🌐
Coursera
coursera.org › tutorials › how to enumerate in python: step by step
How to Enumerate in Python: Step by Step | Coursera
February 24, 2023 - 1 2 3 string = "This is a test string." for index, char in enumerate(string, start=5): print(index, char) You can’t reverse the type of object that the enumerate function returns. However, you can reverse the order by converting the enumerate object into a list or tuple first. You’ll accomplish this by using Python’s list() or tuple() and reversed() functions.
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
🌐
Python Basics
pythonbasics.org › home › python basics › enumerate explained (with examples)
Enumerate Explained (With Examples) - pythonbasics.org
The enumerate() function is a built-in function that returns an enumerate object. This lets you get the index of an element while iterating over a list. In othe
🌐
Real Python
realpython.com › python-enumerate
Python enumerate(): Simplify Loops That Need Counters – Real Python
June 23, 2025 - Calling enumerate() allows you to control the flow of a loop based on the index of each item in a list, even if the values themselves aren’t important to your logic. You can also combine mathematical operations with conditions for the index.
🌐
Python Examples
pythonexamples.org › python-enumerate-a-string
Python - Enumerate a String
string1 = 'apple' for index, ch in enumerate(string1): print(index, ':', ch)
🌐
Stack Overflow
stackoverflow.com › questions › 76911791 › how-does-string-for-i-string-in-enumeratea-work-in-python
How does [string for i, string in enumerate(a)] work in python? - Stack Overflow
Thanks for helping me! My question been answered in the comments, by @juanpa.arrivillaga . Key point of my question is about how python know "I am trying to assign the first element to i and the
🌐
Real Python
realpython.com › ref › builtin-functions › enumerate
enumerate() | Python’s Built-in Functions – Real Python
Language: Python Syntax · enumerate(iterable, start=0) An enumerate object that yields pairs of count and value from the iterable. With a list of strings as an argument: Language: Python · >>> letters = ["a", "b", "c"] >>> for index, letter ...
Find elsewhere
🌐
Guru99
guru99.com › home › python › python enumerate() function: loop, tuple & string
Enumerate() Function in Python: Loop, Tuple, String ...
October 7, 2026 - The Python Enumerate() command adds a counter to each item of the iterable object and returns an enumerate object as an output string.
🌐
Pythonhumanities
intermediate-python.pythonhumanities.com › notebooks › 01-enumerate.html
The Enumerate Function — Intermediate Python for Humanists
The enumerate() function is a built-in Python function that allows you to iterate over a sequence (like a list or a string) and keep track of the index (position) of the current item along with the item itself.
🌐
Great Learning
mygreatlearning.com › blog › it/software development › python enumerate(): simplify looping with counters
Python enumerate(): Simplify Looping With Counters
January 6, 2025 - Let's consider a simple example ... example, the output will be: 0 ('a', 1) 1 ('b', 2) 2 ('c', 3) Enumeration can also be used to iterate through a string....
🌐
Mimo
mimo.org › glossary › python › enumerate-function
Python enumerate(): Loop with an Index and start=
The built-in enumerate() function in Python adds a counter to a sequence and returns the combination as an enumerate object. The enumerate() function takes a sequence like a list, tuple, or string, and returns an enumerate object.
🌐
Codingzap
codingzap.com › home › blog – programming & coding articles › python loops and enumerate(): for, while, break & continue (with examples)
Python Loops and enumerate(): For, While, break & continue (With Examples)
January 5, 2026 - enumerate() is a built-in function that lets you loop over a list, string, or any other iterable while getting both the index and the value at the same time. It is one of the most useful tools you can learn for writing clean loops.
🌐
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))
🌐
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.
🌐
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 · In this example: my_list is a list of strings [‘apple’, ‘banana’, ‘cherry’]. we use the enumerate() function to iterate over my_list.
🌐
Dot Net Perls
dotnetperls.com › enumerate-python
Python - enumerate (For Index, Element) - Dot Net Perls
# ... This is a good way to get indexes and chars from a string. for i, value in enumerate(word): print(i, value) ... The enumerate() built-in must receive an iterable thing. An argument like an integer will cause an error as an integer cannot be looped over. Tip We use the pass statement to indicate an empty loop. Enumerate() fails, so this is not reached. ... Enumerate() is a powerful feature in the Python language.
🌐
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.
🌐
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.