Skip to content

Python code snippet – How to get index in for loop?

for index, item in enumerate(items):
    print(index, item)
See also  How to use if else in Python?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.