The enumerate() Function with Lists in Python


Use enumerate() for getting index and value in a loop.

Source Code

for index, value in enumerate(['a', 'b', 'c']):
    print(f"{index}: {value}")
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments