📜  生成列表 pyton 的所有组合 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:08.886000             🧑  作者: Mango

代码示例1
all_combinations = []
import itertools
for r in range(len(a_list) + 1):
    combinations_object = itertools.combinations(a_list, r)
    combinations_list = list(combinations_object)
    all_combinations += combinations_list