Suppose there are two lists:
l1 = [2,2,3]
l2 = ['a','b','c']
I wonder how one finds the product of the two such that the output would be:
#output: ['a','a','b','b','c','c','c']
if I do:
l3 = []
for i in l2:
for j in l1:
l3.append(i)
I get:
['a', 'a', 'a', 'b', 'b', 'b', 'c', 'c', 'c']
which is wrong, I wonder where am I making the mistake?
for c in a * b
only works if strings are single characters. – Horse