Wszystkie permutacje Python
import itertools
print(list(itertools.permutations([1,2,3])))
Smiling Sable
import itertools
print(list(itertools.permutations([1,2,3])))
>>> from itertools import permutations
>>> perms = [''.join(p) for p in permutations('stack')]
>>> perms
# Function to find permutations of a given string
from itertools import permutations
def allPermutations(str):
# Get all permutations of string 'ABC'
permList = permutations(str)
# print all permutations
for perm in list(permList):
print (''.join(perm))
# Driver program
if __name__ == "__main__":
str = 'ABC'
allPermutations(str)