0
Elements in "lists" are numbered from 0 instead of 1, but why?
English is not my mother language, so there may be some mistakes in my expression. Correct me please >>> I would like to know more about Python and English!đ Thanks for all the reply!
3 Answers
+ 5
Because it's more "natural" in context of variable storage:
A list is stored as a list of references to anothers values, say a list of variables, which takes all the same memory space M, each next other. So, your list is stored to an memory address A, wich is the location of the first reference stored in it, then to adress A+M, is the second, then at A+M+M the third, so you can see the natural of the calculation of the adress of one item given its zero starting index i: A+i*M ^^