python for loop

Lou Pecora pecora at anvil.nrl.navy.mil
Wed Apr 1 09:55:58 EDT 2009


In article <1ej5t4930m29h0f6ttpdcd83t08q2q3sab at 4ax.com>,
 Lada Kugis <lada.kugis at gmail.com> wrote:

> On 01 Apr 2009 01:26:41 GMT, Steven D'Aprano
> <steven at REMOVE.THIS.cybersource.com.au> wrote:
> 
> >
> >Why Python (and other languages) count from zero instead of one, and 
> >why half-open intervals are better than closed intervals:
> >
> >http://www.johndcook.com/blog/2008/06/26/why-computer-scientists-count-from-z
> >ero/
> >http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html
> 
> steven, thanks for answering,
> 
> yes, i saw the second one a little time ago (someone else posted it as
> well in really cute handwriting version :) and the first time just
> now, but the examples which both of them give don't seem to me to be
> that relevant, e.g. the pros don't overcome the cons.
> 
> imho, although both sides (mathematical vs engineer) adress some
> points, none of them give the final decisive argument.
> i understand the math. point of view, but from the practical side it
> is not good. it goes nicely into his tidy theory of everything, but
> practical and intuitive it is not. as i said, being an engineer, i
> tend towards the other side, so this is biased opinion (nobody can be
> unbiased) but from a practical side it seems unpractical for
> engineering problems (and to me, the purpose of computers is to help
> humans to build a better world, not to prove theories - theories are
> useless if they don't help us in reality. so we should try to adapt
> computing to real world, not our world to computers).

There is nothing more practical than a good theory. 
         --- James Clerk Maxwell

You said you came from the C world (besides Fortran).  If so, you have 
already seen array indexing starting with 0 and going to n-1.  

Why, then, should Python be so foreign to you?

-- 
-- Lou Pecora



More information about the Python-list mailing list