Permutacje rekurencyjne Pythona

Mam problem z próbą utworzenia kodu permutacji z rekurencją. Przypuszcza się, że powróci do listy z powrotem do wszystkich pozycji możliwych dla każdej litery. więc na słowocat to ma powrócić['cat','act',atc,'cta','tca','tac'] . do tej pory mam to

def permutations(s):
    lst=[]
    if len(s) == 1 or len(s) == 0 :
        # Return a list containing the string, not the string
        return [s]
    # Call permutations to get the permutations that don't include the
    # first character of s
    plst = permutations(s[1:])
    print(plst)
    for item in plst:
        print (item)
        plst= permutations(s[1+1:])

         # Now move through each possible position of the first character
        # and create a new string that puts that character into the strings
        # in plst
        for i in range(len(s)):
            pass
            # Create a new string out of item
            # and put it into lst
        # Modify
    for item in lst:
        print(index)

Są tam kroki, ale nie wiem, jak z nich korzystać

questionAnswers(7)

yourAnswerToTheQuestion