Answers for "python for in array"

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
7

array in array python

#You can put multiple arrays in one array
tests = [[1,2,3],["r",22,33]]
#prints: [[1,2,3],['r',22,33]]
Posted by: Guest on May-29-2020
2

python for loop in array

for i in foo:
  print(i) #outputs 'foo' then 'bar'
Posted by: Guest on April-07-2021

Python Answers by Framework

Browse Popular Code Answers by Language