Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python enumerate for loop

presidents = ["Washington", "Adams", "Jefferson", "Madison", "Monroe", "Adams", "Jackson"]
for num, name in enumerate(presidents, start=1):
    print("President {}: {}".format(num, name))
Source by treyhunner.com #
 
PREVIOUS NEXT
Tagged: #python #enumerate #loop
ADD COMMENT
Topic
Name
1+5 =