Array of 2^n

Andrew Dalke dalke at dalkescientific.com
Sun Oct 21 05:19:08 CEST 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