index | Sololearn: Learn to code for FREE!



Why does index of lists start with 0?

1/4/2017 10:44:32 AM

Yuta Nagaoka

3 Answers

New Answer


Because it was decided to be like this (it's easier this way).


because number system start with 0


I think It depends on how the list is stored in the Memory of your computer. A binary Number is used to address the list in Memory. To scan trough the list elements a binary Number is used too. by convention a binary Number of all zeroes is refered to the Number 0 I know that some programming languages adopt a different convention and start counting the lists or arrays at 1 there is and interesting article on why we should start counting at 0 written by prof.dr. Edsger W. Dijkstra maybe this helps!