import copy def func(value): ''' 所有的元素不同 :return: ''' num = [] list1 = [] list2 = [] list3 = [] i = -1 for j in value: i += 1 num.clear() for k in value[i:]: num.append(k) a = copy.deepcopy(num) list1.append(a) for n in list1: set1 = set(n) list4 = list(set1) list2.append(list4) for m in list2: if m not in list3: list3.append(m) print(list3) aar = [1,3,5,5,7,9] func(aar)