Using Loops to track user input

hokiegal99 hokiegal99 at hotmail.com
Sun Jul 6 20:31:15 EDT 2003


Perl's motto is "there's more than one way to do it," right? Well, after 
reading all of these responses, I think Python could make the same 
claim. Thanks again guys!


Bob Gailer wrote:

> Not to neglect the 1-liner:
> 
> import operator; reduce(operator.add,[int(raw_input("Number>")) for i in 
> range(10)])
> 
> Bob Gailer
> bgailer at alum.rpi.edu
> 303 442 2625





More information about the Python-list mailing list