Begginers Guide - Exrcise. Help me, plz!

Jim Dennis jimd at vega.starshine.org
Thu Mar 21 18:03:31 EST 2002


In article <mailman.1016313447.30968.python-list at python.org>, 
  Sean 'Shaleh' Perry wrote:

>On 16-Mar-2002 Jeffrey-man wrote:
>> Hello, everybody!
>> I'm a newbie and I'm just learning. I know, it's a stupid question, but I
>> want to resolve it.
>> Learning the Begginers Guide, I found an exercise. It tells me:
>> "Write a program that continually reads in numbers from the user and adds
>> them together until the sum reaches 100."
>> Can anybody help me?

 ...

>> Maybe I'm doing something wrong?

> you misread the specification.

> You are to ask the user "give me a number", add that number to the 
> previous one (hint: use zero the first time), then check if the new 
> sum is less than the stopping point (100 in this case).  If the stopping 
> point is reached, cease asking for a number.

>Does that help?

 Shouldn't all these (helpful) examples be using raw_input() rather
 than input().  Do we really want the new user to be implicitly and
 blindly using eval(raw_input())?





More information about the Python-list mailing list