在Python中,您可以使用如下itertools生成排列:
>>> list(itertools.permutations("ABC", 2))
[('A', 'B'), ('A', 'C'), ('B', 'A'), ('B', 'C'), ('C', 'A'), ('C', 'B')]
Run Code Online (Sandbox Code Playgroud)
朱莉娅有一个类似的permutations功能,但它只接受一个参数.在Python函数中模拟第二个参数的最佳方法是什么?