Contact: aviboots(AT)netvision.net.il
39,861 questions
51,782 answers
573 users
lst1 = [1, 2, 4] lst2 = [1, 4] lst = [(a, b) for a in lst1 for b in lst2 if a != b] print(lst) ''' run: [(1, 4), (2, 1), (2, 4), (4, 1)] '''