python for loop

Lada Kugis lada.kugis at gmail.com
Wed Apr 1 04:37:41 CEST 2009


On Tue, 31 Mar 2009 19:29:56 -0700, Chris Rebert <clp2 at rebertia.com>
wrote:


>Sort of, but it's *really* not idiomatic. You'd have to declare the
>arrays to be one longer than they actually are so that array[N] is a
>valid index. And then you'd end up not using the true first element of
>the array. Not to mention most library functions use 0-numbering, so
>you'd have to work around that as well.
>
>So, it can be done, but you're going against the grain of the language.

I use fortran libraries, so that is not a problem for me. I only make
the change once, while transferring the elements ... uhmm, make that
twice.
I wrote in my other post, 0 is weird to me, I have model of solution
on paper ... if I keep 0 then all comes out different. And while
comparing, I always get them mixed up. That's why I always try to
adapt it to the paper situation.

Lada


>
>Cheers,
>Chris



More information about the Python-list mailing list