permutations.py

Created by bclerc

Created on May 04, 2018

246 Bytes

Permutations de trois éléments pris parmi trois (ou plus) éléments


L = [11,7,3,5]
PERM = []
for x in L:
  for y in L:
    if y!=x:
      for z in L:
        if z!=x and z!=y:
          if len([x,y,z])==3:
            PERM = PERM + [(x,y,z)]
print(PERM)
print(len(PERM),"permutations en tout.")