Counting: 1st Order Indexing
As humans we often live in the decimal system, this is because we have ten fingers and ten number characters.
It has been a common convention to count using First order indexing. By this convention our first finger is 1, our second finger is 2, our third finger is 3, our 4th finger is 4, our 5th finger is 5, our 6th finger is 6, our 7th finger is 7, our 8th finger is 8, our 9th finger is 9 and our tenth finger is 10…
With this method of counting the obvious problem is that we do not map all 10 numerical digits [0,1,2,3,4,5,6,7,8,9] to our 10 fingers. This is resolved with Zero Order Indexing.
Counting: 0th Order Indexing
In this convention our zeroth finger is 0, our 1st finger is 1, our 2nd finger is 2, our third finger is 3, our 4th finger is 4, our 5th finger is 5, our 6th finger is 6, our 7th finger is 7, our 8th finger is 8 and our 9th finger is 9. Python uses, this convention so take a moment to learn how to count again and it will help you greatly when using Python.
Note when we count to 10 using 0th order indexing, we could up to the value 10 but don't include it. This aligns with our decimal notation:
Where each number up to 10 including 0 is represented by a single digit.
If we only look at one of our hands, we count up to but not including 5. This gives us:
Advantage of Zero Order Indexing
The main advantage of Zeroth order indexing is that difference between a value and the starting value is equal to that value opposed to the value minus 1. Likewise addition of the stating point to a value is equal to the value opposed to the value minus 1.
|Difference from Start Point (1st Order Indexing)||Difference from Start Point (0th Order Indexing)||Addition of Start Point (1st Order Indexing)||Addition from Start Point (0th Order Indexing)|