Recursive Permutation in Python