How I can multiply
a = ['raj' , 'rj' , 'reba']
with
b = [1,2,2] # integers
to get the output as
c = ['raj' , 'rj' , 'rj' , 'reba' , 'reba']
My current attempt is:
from itertools import chain
a = ['raj', 'rj','reba']
b = [1, 2, 2]
for i in range(len(a)):
c.extend(list(a[i]*b[i]))
My current output:
['r', 'a', 'j', 'r', 'j', 'r', 'j', 'r', 'e', 'b', 'a', 'r', 'e', 'b', 'a']