[Tutor] Number Sum Up
Lin Zhang
lizliao@yahoo.com
Thu, 31 Aug 2000 10:11:32 -0700 (PDT)
Something like the following (in a .py file) should
work:
n=0
while n<100:
n = n+float(raw_input("Please enter a number: "))
print "The summation of your input: ", n
Cheers!
--- "Michael J. Boylan" <mjboylan@sover.net> wrote:
> I am just starting to learn python, and am stuck on
> a simple programming
> exercise.
>
> "Write a program that continually reads in numbers
> from the user and adds
> them together until the sum reaches 100".
>
> Seems simple, but I can't get it. Any help?
>
> thanks,
>
> Mike
>
> _______________________________________________
> Tutor maillist - Tutor@python.org
> http://www.python.org/mailman/listinfo/tutor
__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/