Chris Fuller wrote:
> This is a good case for recursion. My solution is in two steps.
> Here is the code:
>
> def recursion_is_your_friend(l):
>if len(l) == 1:
> return l
>else:
> return [ (i, recursion_is_your_friend(l[1:])) for i in l[0] ]
>
> l = recursion_is_your_friend([[
This is a good case for recursion. My solution is in two steps. A
straightforward application of recursion (I was casting about semi-randomly)
yields a attractive tree structure:
root
a b
c d e c de
f f f f ff
g h
Greeting from a real newbie,
I think that their might exist an easy way, in Python, for my list
permutation issue. I need to be able to permute all elements from across
several lists, while ensuring order is maintained across the lists.
For example: list1=[a b] list2=[c d e] list3=[f] list4=[