Answers for "how to find permutation of numbers in python"

0

how to find permutation of numbers in python

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
Posted by: Guest on June-18-2021

Code answers related to "how to find permutation of numbers in python"

Python Answers by Framework

Browse Popular Code Answers by Language