Python "why" questions

Neil Cerutti neilc at norwich.edu
Fri Aug 13 19:36:08 CEST 2010


On 2010-08-13, Thomas Jollans <thomas at jollans.com> wrote:
> 1-based indexing might seam more intuitive, but in the end,
> it's just another thing you have to learn when learning a
> language, like "commas make tuples", and somebody studying a
> programming language learns it, and gets used to it if they
> aren't used to it already.

I think the main reason zero-based indexing is chosen in higher
level languages is the following useful property:

x[n:m] + x[m:len(x)] == x

-- 
Neil Cerutti



More information about the Python-list mailing list