Newbie ?:A more concise way?

Peter Hansen peter at engcorp.com
Sun Mar 3 23:37:04 EST 2002


Brian wrote:
> 
> z = [MyClass() for i in xrange(y)]
> 
> Is there a way to do this without the use of i?

The big advantage being?

(I'd suggest if you're just trying to save typing five
keystrokes that you find more critical things to work on first.)

-Peter



More information about the Python-list mailing list