标签: python
如何生成列表的幂集?
我尝试为此使用itertools库
itertools
def findsubsets(s, n): return list(itertools.combinations(s, n)) s = input().split() n = len(s) aint = int(input()) powerset = [] for i in range(n): subset = findsubsets(s, n)