Runtime v2.81 · Updated Sep 30, 2026

enumerate

Return a list of tuple(index, item) pairs for any iterable value.

Syntax

enumerate(iterable, start=0)

Parameters

NameDescription
iterableString | list | tuple | dict
Value to enumerate. Dictionaries enumerate keys.
Required · Positional or named
No default
startInt
First index value.
Optional · Positional or named
Default: 0

Returns

list[tuple] — list of two-item tuples: index first, original item second.

Behavior / side effects

Return a list of tuple(index, item) pairs for any iterable value.

Execution

  • Blocking: No
  • Thread safety: Use separate objects per flow
  • Parallel execution: Yes

Value operations execute in the calling flow without an intentional wait for capture, gesture completion, or user input. Create mutable containers/builders separately in each flow; this is isolation, not a shared-object synchronization guarantee.

Example

# Number items before using them
names = ["alpha", "beta"]
for pair in enumerate(names, start=1):
    text(str(pair[0]) + ": " + pair[1])

Errors / limitations

No additional limitations documented; follow the parameter and behavior contract above.

Related APIs

None