On Sun, Jul 26, 2015 at 10:04:19AM +0530, Anurag Vyas wrote:
> Hello Team,
> I am noob to programming. I am trying to remove a item from a list. The
> item that I am trying to remove has multiple entries in the list. I am not
> able to remove all the entries.
> Please Help. The code is in the attac
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