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
I know this is a me too, but I think this one might be easier for some folks to understand....
Another for loop recursively permutes through all the other possibilities.
def permute(s):
out = []
if len(s) == 1:
out = [s]
else:
for i,let in enumerate(s):
for perm in permute(s[:i]+s[i+1:]):
out += [let+perm]
return out