Array of 2^n

Andrew Dalke dalke at dalkescientific.com
Sat Oct 20 23:19:08 EDT 2001


Moshe:
I want to make a n-item
>list such that mylist[i] = 2**i. How can I generate such a list in Python?

mylist = [2**i for i in range(n)]

                    Andrew
                    dalke at dalkescientific.com






More information about the Python-list mailing list