If I had two lines, 'abc' and 'def' , I could get all of their combinations, using two for loops:
for j in s1: for k in s2: print(j, k)
However, I would like to be able to do this using a list comprehension. I tried many ways, but could not. Does anyone know how to do this?
python for-loop list-comprehension
John Howard Sep 03 '10 at 4:57 2010-09-03 04:57
source share