Content · Programming · Python

Python enumerate() Function: Usage and Examples

enumerate(iterable, start=0) yields pairs of an index and a value as you loop. Set start=1 to display human-friendly numbering without changing the underlying list indexes. See two practical examples, edge cases and.

2 views Published Oct 17, 2026 Updated Oct 18, 2026 Admin

A restaurant menu displays numbered choices.

What You Need to Understand


enumerate(iterable, start=0) yields pairs of an index and a value as you loop. Set start=1 to display human-friendly numbering without changing the underlying list indexes.

When to Use It


A restaurant menu displays numbered choices.

Step-by-Step Python Example


dishes = ["Soup", "Salad", "Pasta"]
for number, dish in enumerate(dishes, start=1):
    print(f"{number}. {dish}")

How the Example Works


The index begins at 1 for display, and each pair contains the current number and dish.

Example Output


1. Soup
2. Salad
3. Pasta
10 a
11 b

A Second Example


Compare this smaller variation with the main example, then experiment with your own values.

for number, item in enumerate(["a", "b"], start=10):
    print(number, item)

Important Behavior and Edge Cases


enumerate does not change the actual index positions of the source list. If you need random access to a list element, actual positions still begin at zero.

Try It Yourself


Number four tasks starting at 10.

Common Beginner Mistakes


  • enumerate does not change the actual index positions of the source list. If you need random access to a list element, actual positions still begin at zero.
  • Overlooking how an iterable is consumed, how element positions are chosen, or whether a function creates a new list.

Key Takeaways


  • enumerate(iterable, start=0) yields pairs of an index and a value as you loop.
  • The index begins at 1 for display, and each pair contains the current number and dish.
  • enumerate does not change the actual index positions of the source list.
Share this resourceSend this page to someone who may find it useful.