python list index - an easy question
bc at freeuk.com
Mon Dec 19 05:26:56 EST 2016
On 19/12/2016 01:10, Ben Bacarisse wrote:
> BartC <bc at freeuk.com> writes:
>> On 18/12/2016 10:59, Paul Götze wrote:
>>> there is a nice short article by E. W. Dijkstra about why it makes sense
>>> to start numbering at zero (and exclude the upper given bound) while
>>> slicing a list. Might give a bit of additional understanding.
>> (This from somebody who apparently can't use a typewriter?!)
>> I don't know if the arguments there are that convincing. Both lower
>> bounds of 0 and 1 are useful; some languages will use 0, some 1, and
>> some can have any lower bound.
>> But a strong argument for using 1 is that in real life things are
>> usually counted from 1 (and measured from 0).
> The index of an element is a measure, not a count.
You need to take your C hat off, I think.
More information about the Python-list