Answers for "python iterate by the len of the array"

4

how to loop the length of an array pytoh

array = range(10)
for i in range(len(array)):
  print(array[i])
Posted by: Guest on March-07-2020
4

iterate through an array python

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

Python Answers by Framework

Browse Popular Code Answers by Language