On 10/3/07, vimal <[EMAIL PROTECTED]> wrote:
> hi all,
>
>      i am new to python.....
>      i just want to generate numbers in the form like:
>
>     1,2,4,8,16,32.....to a maximum of 1024
>
>     using a range function

[2**i for i in range(11)]

This is a list comprehension, for more have a look at
http://docs.python.org/tut/node7.html#SECTION007140000000000000000

Cheers,

-- 
----
Amit Khemka
website: www.onyomo.com
wap-site: www.owap.in
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to