Answers for "how to get the index of a list in a loop python"

1

for loop with enumerate python

presidents = ["Washington", "Adams", "Jefferson"]
for num, name in enumerate(presidents, start=0):
    print("President {}: {}".format(num, name))
Posted by: Guest on June-25-2020

Code answers related to "how to get the index of a list in a loop python"

Python Answers by Framework

Browse Popular Code Answers by Language