Answers for "python for with getting index"

0

python loop with index

presidents = ["Washington", "Adams", "Jefferson", "Madison", "Monroe", "Adams", "Jackson"]
for num, name in enumerate(presidents, start=1):
    print("President {}: {}".format(num, name))
Posted by: Guest on December-17-2021

Python Answers by Framework

Browse Popular Code Answers by Language