Array of 2^n

Rikard Bosnjakovic rikard at strakt.com
Mon Oct 22 10:15:35 EDT 2001


Moshe wrote:

>>l = [2**i for i in range(10)]
> 
> I definitely like this way more than the lambda way, because it is far
> more readable.


Plus; lambdas exist in Python <2.0, list comprehensions don't.

(Yes, there *are* people using 1.5.x still)




-- 
Cheers,
------------------------------------------------------------------------
Rikard Bosnjakovic                               http://bos.hack.org/cv/
Python Hacker                                          rikard at strakt.com
AB Strakt                                                   bos at hack.org




More information about the Python-list mailing list