I need a kick in the head on this one. I have the following recursive function defined:
def perms(s): if(len(s)==1): return s res = \'\' for x in
Here is the code:
def fperms(elements): if len(elements)<=1: yield elements else: for p in fperms(elements[1:]): for i in range(len(elements)): yield p[:i]+elements[0:1]+p[i:]