Answers for "how to iterate throough a python array using index"

4

python for loop array index

colors = ["red", "green", "blue", "purple"]
i = 0
while i < len(colors):
    print(colors[i])
    i += 1
Posted by: Guest on August-29-2020
0

python iterate with index

for index, item in enumerate(iterable, start=1):
   print index, item
Posted by: Guest on November-27-2020

Code answers related to "how to iterate throough a python array using index"

Python Answers by Framework

Browse Popular Code Answers by Language