def perm2(str1):
    from itertools import permutations
    return [''.join(p) for p in permutations(str1)]
>>> perm2('123')
dataset/ETHPy150Open bt3gl/Python-and-Algorithms-and-Data-Structures/src/builtin_structures/permutations.py/perm2