Python traverse two lists at the same time
list1 = ['a', 'b', 'c', 'd']
list2 = ['apple', 'boy', 'cat', 'dog']
for x, y in zip (list1, list2):
print (x, y)
Note: the two lists are the same length
Python traverse two lists at the same time
list1 = ['a', 'b', 'c', 'd']
list2 = ['apple', 'boy', 'cat', 'dog']
for x, y in zip (list1, list2):
print (x, y)
Note: the two lists are the same length