Python: enumerate() reference
1 October 2023 (Updated 1 October 2023)
Example
fruits = ["apple", "banana", "cherry", "date"]
for index, fruit in enumerate(fruits):
print(index, fruit)
Output
0 apple
1 banana
2 cherry
3 date
Tagged:
Python
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment