Answers for "how to use the value fro enumerate loop in python"

4

python for enumerate loop

>>> values = ["a","b","c"]
>>> for count, value in enumerate(values):
...     print(count, value)
...
0 a
1 b
2 c
Posted by: Guest on December-23-2020
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

Python Answers by Framework

Browse Popular Code Answers by Language