排列组合

def perm(arry):
    if arry==[]:
        return [arry]
    resultList = []
    for i in range(len(arry)):
        restArry=arry[:i]+arry[i+1:]
        for x in perm(restArry):
            resultList.append(arry[i:i+1]+x)
    return resultList

 

posted @ 2019-08-17 18:32  reyinever  阅读(133)  评论(0编辑  收藏  举报