How do you do arrays

beliavsky at aol.com beliavsky at aol.com
Tue Feb 1 16:03:12 EST 2005


wes weston wrote:
> Thomas,
>     If you were allowed to do what you're doing, the
> list first element would be getting skipped as "index"
> is always > 0. The thing is, you don't want the "index"
> var at all for adding to the list; just do jMatrix.append(k).
>     You can iterate over the list with
> for x in jMatrix:
>     print x
>
>     Is it basic that indexes from 1 vs. 0? 'just about
> completely forgotten basic.
> wes

I think most versions of Basic have arrays that by default start with
1, as did their ancestor, Fortran, although other lower bounds can be
specified. VB.NET, Microsoft's successor to Visual Basic, requires
arrays to start with zero.




More information about the Python-list mailing list