how to iterate over a list in python

33

lst = [10, 50, 75, 83, 98, 84, 32]
 
for x in range(len(lst)): 
    print(lst[x]) 
lst = [10, 50, 75, 83, 98, 84, 32] 
 
res = list(map(lambda x:x, lst))
 
print(res) 
list_1 = [1, 2, 3, 4]
list_2 = ['a', 'b', 'c']

for i, j in zip(list_1, list_2):
    print(i, j)

Comments

Submit
0 Comments