input: Write a python function to generate all permutations of a string.
  assert sorted(permutations("ABC")) == sorted(["ABC", "ACB", "BAC", "BCA", "CBA", "CAB"])
  assert sorted(permutations("AB")) == sorted(["AB", "BA"])
  assert sorted(permutations("A")) == sorted(["A"])
output: def permutations(s):
      if len(s) == 1:
          return [s]
      perm_list = [] 
      for i in range(len(s)):
          part = s[i]
          rest = s[:i] + s[i+1:]
          for perm in permutations(rest):
              perm_list.append(part + perm)
      return perm_list