SHARE
TWEET

Untitled

a guest Jun 15th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import itertools
  2. A=[10, 20, 30,40]
  3. B=[11,21,31,41]
  4.  
  5.  
  6. for x in range (1,min(len(A),len(B))):
  7.     newA = list(itertools.combinations(A,x))
  8.     newB = list(itertools.combinations(B,x))
  9.     for itemA in newA:
  10.         for itemB in newB:
  11.             to_print = True
  12.             for index in range (min(len(itemA),len(itemB))):
  13.                 if itemA[index] >= itemB[index]:
  14.                     to_print = False
  15.                     break
  16.             if to_print == True:
  17.                 for index in range (len(itemA)):
  18.                     print (itemA[index], itemB[index], sep=" ", end= " ")
  19.                 print("")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top