Missing the functional mind set

Alex Martelli aleaxit at yahoo.com
Sun Mar 4 16:39:53 EST 2001


"Steve Williams" <stevewilliams at wwc.com> wrote in message
news:3AA298F5.7742810E at wwc.com...
    [snip]
> To be consistent with the "index == offset" mindset, counting should
> start at zero.
>
> As in:  "I have 2 children--0 boy and 1 girls".

Counting _does_ start at 0 -- you enumerate elements of a set
and check which ones satisfy a certain property, the count starts
and stays at zero until it's bumped up the first time, then it goes
to 1, and so on.  But 0+1=1, so you have an off-by-one error
somewhere in your family, I'm afraid...


Alex






More information about the Python-list mailing list