Answers for "loop over array of objects and print the values python"

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
1

how to iterate over a list in python

lst = [10, 50, 75, 83, 98, 84, 32] 
 
res = list(map(lambda x:x, lst))
 
print(res)
Posted by: Guest on July-23-2020

Code answers related to "loop over array of objects and print the values python"

Python Answers by Framework

Browse Popular Code Answers by Language