Beginner Programmer Question

SuperHik junkytownMAKNI at gmail.com
Mon Jun 26 19:41:05 CEST 2006


kydavis77 at gmail.com wrote:
> I am doing alot of reading and trying to teach myself how to program.
> I can not figure out how to make "Write a program that continually
> reads in numbers from the user and adds them together until the sum
> reaches 100." this work. If someone could show me the correct code so i
> can learn from that it would be much appreciated. Thanks
> 

summ = 0
while summ < 100:
     usr = input('Enter a number:')
     summ += usr   #that's same as>>> summ = summ + usr
     print summ

print "now continue with whatever you want..."



More information about the Python-list mailing list