[Tutor] (no subject)
Moshe Zadka
Moshe Zadka <moshez@math.huji.ac.il>
Thu, 31 Aug 2000 10:27:26 +0300 (IDT)
On Wed, 30 Aug 2000, Michael J. Boylan 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?
Programming is about taking a problem and dividing it into smaller
problems, and then solve them.
So let's divide the problem
1. Read numbers from the user. See input(), raw_input() and int() in the
library reference.
2. Add numbers -- this should be easy
3. Do something continuously until something happens -- see tutorial
about the while loop
--
Moshe Zadka <moshez@math.huji.ac.il>
There is no IGLU cabal.
http://advogato.org/person/moshez