Prosta permutacja Pythona, aby uzyskać wyjście, jest tworzenie listy, a następnie drukowanie
from itertools import permutations
print(list(permutations([1,2,3])))
Outrageous Ostrich