Это проще сделать с помощью метода combinations
:
l1 = [1,2,3,4,5,6]
l2 = [1,2,3]
[l, l2].combinations()
Какие выходы:
[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1], [1, 2], [2, 2],
[3, 2], [4, 2], [5, 2], [6, 2], [1, 3], [2, 3], [3, 3], [4, 3],
[5, 3], [6, 3]]