📜  如何在python代码示例中找到数字的排列

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

代码示例1
def permute(LIST):
    length=len(LIST)
    if length <= 1:
        yield LIST
    else:
        for n in range(0,length):
             for end in permute( LIST[:n] + LIST[n+1:] ):
                 yield [ LIST[n] ] + end

for x in permute(["3","3","4"]):
    print x