Limit between 0 and 100

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Mon Oct 27 13:05:42 EDT 2008


(Sorry for the answering delay, Google groups is very slow.)

James:

>P.S. I don't understand a lot of what I have there, I got most of it from the beginning tutorials and help sections. I have never programmed before, but this is for a school assignment.<

You must understand what you do at school, otherwise it's just wasted
time, trust me. If you don't understand what you do, then it's better
to do something else, like fishing, or reading things you do
understand. Doing things like a robot eventually makes your brain
dumb. Do you like to become dumb?

You can't learn to program on the spot, but I suggest you to limit the
things you don't understand as much as possible.

And you can start a Python interpreter and try every single little
small thing you put into your program (and you can look for them into
the python documentation), so you can have an idea of what you are
doing. You may even try to read the notes/things your teacher may have
shown you.

What's float()?
What's raw_input()?
What's the purpose of the 'integer' variable?
What does break means, and what's its purpose there?

Maybe learning what exceptions are now it too much early, so it may be
better to not use that try-except at all, and just let your program
fail and give an error if you don't input something good. This way you
can reduce the things you don't understand. Better to show the teacher
a bare-bones program that you understand a little, than a refined
program that you don't understand at all.

Bye,
bearophile



More information about the Python-list mailing list