Answers for "for loop enumerate"

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
0

for enumerate python

for key, value in enumerate(["p", "y", "t", "h", "o", "n"]):
    print key, value

"""
0 p
1 y
2 t
3 h
4 o
5 n
"""
Posted by: Guest on June-21-2020
0

iterate an enumeration

Dim items As Array
items = System.Enum.GetValues(GetType(FirstDayOfWeek))
Dim item As String
For Each item In items
    MsgBox(item)
Next
Posted by: Guest on October-09-2021

Python Answers by Framework

Browse Popular Code Answers by Language