小编Ram*_*ams的帖子

itertools.permutations的无序版本

以下程序使用构造列表中的URL itertools.permutations

def url_construct_function():
    for i in range(1, len(samplelist)):
        for item in list(permutations(samplelist, i)):
Run Code Online (Sandbox Code Playgroud)
  1. 假设有在样本列表中显示3项:abc
  2. itertools.permutations 围绕各种可能的有序组合提供了很好的描述
    • 一种
    • b
    • C
    • a,b
    • a,c
    • 公元前
    • c,b

我想让程序理解这一点,a,b并且b,a是相同的。

python

4
推荐指数
1
解决办法
1194
查看次数

标签 统计

python ×1