iterate till the end of second array using python

Viewed 120

I have done something like this:

d = [('e', 0), ('f', 1), ('e', 0), ('f', 1)]
e = ['a']
d = [(n,j) for n,(i,j) in zip(e,d)]
d
[('a',0)]

I was just tryig to replace the equivalent tuple value with the array value, without changing the associated numbers. But the list only goes till the len of array e and not d. What I want to get as output is something like this:

d
[('a', 0), ('f', 1), ('e', 0), ('f', 1)]
4 Answers
Related