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