array slices in python

beliavsky at aol.com beliavsky at aol.com
Mon May 12 20:19:58 EDT 2003


In Python, "a[1:3]" refers to elements a[1] and a[2]. 
In Fortran 95, "a(1:3)" refers to elements a(1), a(2), and a(3), which
seems more natural. Matlab works the same way.

What is the rationale for the Python convention for array slices?




More information about the Python-list mailing list