import itertools list1=[14140,13260,14300,14500,14040,13940,13620,13980,17280,13580,13740] mylist = list(itertools.permutations(list1,4)) a=set() for i in mylist: ii=sum(i) if ii==59400: iii=tuple(sorted(list(i))) a.add(iii) print(a)
import itertools list1=[14140,13260,14300,14500,14040,13940,13620,13980,17280,13580,13740] mylist = list(itertools.permutations(list1,4)) a=set() for i in mylist: ii=sum(i) if ii==59400: iii=tuple(sorted(list(i))) a.add(iii) print(a)