lst = ["a","b","c","d"] 取出3个元素不重复的组合,不在意顺序,即abc和acb是一样的,只有4种结果 import itertools for i in itertools.combinations(lst, 3)