实例: 若集合A有n个元素,则集合A的子集个数为2n,且有2n-1个真子集,2n-2个非空真子集。
用python中的itertools.combinations(iterable, r)实现了一下: r: 某特定长度的子序列
itertools.combinations(iterable, r)
另玩了下combinations_with_replacement和 product:
combinations_with_replacement
product