Replace for Goto

Michele Simionato mis6 at pitt.edu
Fri May 30 09:56:39 EDT 2003


dvm5_0 at hotmail.com (Dvm5) wrote in message news:<aa2e3602.0305291436.65bf3f38 at posting.google.com>...
> "Robert Clark" <res03db2 at gte.net> wrote in message news:<mailman.1054189309.17665.python-list at python.org>...
> > play the game once
> > priming read
> > while answer is yes
> > play the game again
> > trailing read
> > wend
> 
> I thought of that, but that is what I was specifically trying to
> avoid. I dunno, mybe cause I was usually programming for calulators
> (Some highschool classes just get SO boring and POINTless ^_^ ) so I'm
> usually trying for eficiency. I wanted to prevent using such an
> inefficient method.

Why do you think the while loop is more inefficient than goto ?
Are you referring to pocket calculators ?? Have you ever timed the
difference ???

Don't think in terms of efficiency. Premature optimization is the root
of all evil. 

> And, (being efficent: To all those who are (slightly) demeaning with
> the newbie suggestion, I've been through those, it's just hard to
> alter thinking from one to the other, I'm used the flow of basic (and
> calculators) so altering the mindset is tough. I understand you were
> all trying to help.
> 
> Sorry for rambling! 
> 
> And thanks for everyone's help, I think the while loop will do nicely.
> Thanks again!
> -DVM5

I started programming with pocket calculators in Basic and it was a
PITA;
the flow of Python is much easier (for me, at least). It is better if
you forget
everything you know about pocket calculators and you look at some good
programming book for beginners (my suggestion: look at
http://www.ibiblio.org/obp/thinkCSpy/)

                           Michele




More information about the Python-list mailing list