[Tutor] Recursion and List Comprehensions

Carroll, Barry Barry.Carroll at psc.com
Sat Oct 29 03:35:53 CEST 2005


Greetings:

Andrei gave me the answer I needed:
<<snip>>
>Let's fix that by extending the list instead:
>
>   retList.extend([word[pos] + item for item in permuteList])
>
<<snip>>

The extend method solved the problem.  

Barry

>-----Original Message-----
>From: Carroll, Barry 
>Sent: Friday, October 28, 2005 5:49 PM
>To: 'Alan Gauld'; Carroll, Barry; tutor at python.org
>Subject: RE: [Tutor] Recursion and List Comprehensions
>
>Alan et al:
>
>After reading the topic you recommended I tried rewriting my permute
>function as follows: 
>

<<snip>>




More information about the Tutor mailing list