i have a doubt in combining 2 lists into one in a certain way. can anyone help me out?
i have 2 lists
a = ['a', 'b', 'c', 'd', 'e']
b = [1, 2, 3]
i want the resultant list like ['a1', 'b2', 'c3', 'd1', 'e2']
The result list must be generated by iterating through the list a and simultaniously cycling through the list b.
i have tried the following code
r = ['%s%d' % item for item in zip(a,b)]
but the output I'm getting is,
['a1', 'b2', 'c3']