Lists & loops
Easy
Enumerate with index
Loop with both index and value — cleaner than manual counters.
How it works
enumerate(iterable) yields (index, item) pairs starting at 0 by default.
Pass start=1 when you want human-friendly numbering in printed output.
Prefer enumerate over range(len(x)) — it is shorter and avoids index mistakes.
tasks = ["read docs", "write code", "run tests"]
for i, task in enumerate(tasks, start=1):
print(f"{i}. {task}")
Sponsored
Sponsored
Reserved space — layout preview until AdSense is connected