loops

Paul Rubin http
Sun Oct 19 07:57:54 CEST 2008


"James Mills" <prologic at shortcircuit.net.au> writes:
> > for x in (2**i for i in xrange(10)):
> >    print x
> This is by far the most concise solution I've seen so far.

print '\n'.join(str(2**i) for i in xrange(10))



More information about the Python-list mailing list