Beginner Programmer Question

kydavis77 at gmail.com kydavis77 at gmail.com
Mon Jun 26 13:37:53 EDT 2006


kydavis77 at gmail.com wrote:
> Claudio Grondi wrote:
> > 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
> > >
> > Isn't it your homework?
> > Why can't you figure it out?
> > What have you tried?
> >
> > Claudio
>
> I am doing alot of reading, and the problem didnt come with an answer.
> I dont understand how to get it to continually input numbers and add
> all those together

#Add up to 100 program

#What number are you adding up to?
bigone = 100

number = input("Whats the first number?")
number2 = input ("Whats the second number?")
nu3 = number+number2
while nu3 < bigone:
    print ("Not there yet, next number please")


print "Finally there!"

thats what i thought maybe it was...but after the first two numbers it
just continually scrolls on the screen with finally there




More information about the Python-list mailing list