(Sep-15-2021, 03:11 AM)bowlofred Wrote: Both are discussed in this post:
http://python-history.blogspot.com/2013/...exing.html
That article and at least one that it links to are complicated. Here is a simpler explanation.
In languages such as C, the elements of an array are arranged sequentially in memory. If
n
is the size of each element, p
the machine memory address of the beginning of the array and i
a subscript then each element is at machine address p+i*n
. Therefore the first element is at memory address p+0
therefore the subscripts begin at 0. Beginning at zero is the efficient way to communicate with the computer for languages compiled to machine code and other languages do the same even if (as in Python) they are interpreted or something like that.