python for loop

Lie Lie.1296 at gmail.com
Thu Apr 2 00:58:47 EDT 2009


On Apr 1, 7:06 pm, Steven D'Aprano
<ste... at REMOVE.THIS.cybersource.com.au> wrote:

> There is a major clash between the names of ordinals in human languages
> and zero-based counting. In human languages, the Nth-ordinal item comes
> in position N. You can keep that useful convention with zero-based
> counting by inventing the ugly word "zeroth", but that just leads to
> bizarro-talk like "the zeroeth item comes first, the first item comes
> second, and so on".

No, there won't be any bizarro-talk. There is no argument: the zeroeth
item comes zeroeth, the first item comes first, and so on. The index
for the very zeroeth thing in a list is 0, so to get the zeroeth item
you use s[0]. While to get the first item you use s[1]. It's very
intuitive, isn't it?



More information about the Python-list mailing list