[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] python, "pakke liste ud"



On Fri, 2008-02-15 at 09:16 +0100, Kristian Nørgaard wrote:
> > def banan(lsts):
> >  combinationer = [[x] for x in lsts[0]]
> >  return reduce(lambda lst1,lst2:[x+[y] for x in lst1 for y in lst2], 
> > lsts[1:], combinationer)
> 
> Vil følgende så ikke også virke:
> 
> def melon(lsts):
>    return reduce(lambda l1,l2:[x+[y] for x in l1 for y in l2], lsts,[[]])

Det er lidt farligt at bruge lambda/reduce da de er på vej ud af python.

http://www.artima.com/weblogs/viewpost.jsp?thread=98196

Dog siger Van Rossum at reduce bliver, men alligevel

Bo




 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2008-03-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *