lista = ["a","b","c"] def perm (s,a): for i in a: b=a[:] b.remove(i) if(len(b)): perm(s+str(i)+",",b) else: print s+str(i) perm("",lista)