lets say I have one list ['A','B','C']
and the second [1,2]
I want to create a new list [(A,1), (A,2), (B,1)...]
Obviously it can be trivially done using a for loop like this:
a = ['A','B','C']
b = [1,2]
c = []
for x in a:
for y in b:
c.append((x,y))
c
[('A', 1), ('A', 2), ('B', 1), ('B', 2), ('C', 1), ('C', 2)]
but how can I do it using the [x for x in...] syntax ?