Im having trouble trying to make a permutation code with recursion. This is suppose to return a list back to the use with all the posible position for each letter. so for t
def permute(s):
ch = list(s)
if len(ch) == 2:
per = ch[1] + ch[0]
return [''.join(ch)] + [per]
if len(ch) < 2:
return ch
else:
return [ init+per for init in ch for per in permute(''.join(ch).replace(init,""))]