Given the following lists:
a = ['a','b']
b = [1,2,3,4]
I'd like to produce this:
c = ['a1','a2','a3','a4','b1','b2','b3','b4']
So I basically want to join every element of b to each element in a.
I'd like an approach similar to this:
[x+str(y) for x in a and y in b]
Thanks in advance!
c = [x+str(y) for x in a and y in b]is the solution which you have included in your question, what are you actually asking for?