from itertools import permutations


def possible_permutations(elements):
    perm = permutations(elements)
    for p in perm:
        yield list(p)


[print(n) for n in possible_permutations([1, 2, 3])]

2091b82c86dd0683df3a4604338f540a3259cf3e
<mask token>

<mask token>


def possible_permutations(elements):
    perm = permutations(elements)
    for p in perm:
        yield list(p)


<mask token>

<mask token>


def possible_permutations(elements):
    perm = permutations(elements)
    for p in perm:
        yield list(p)


[print(n) for n in possible_permutations([1, 2, 3])]

from itertools import permutations


def possible_permutations(elements):
    perm = permutations(elements)
    for p in perm:
        yield list(p)


[print(n) for n in possible_permutations([1, 2, 3])]
