[Edu-sig] Re: Confusion with slice notation

Terry Hancock hancock at anansispaceworks.com
Mon Jan 5 16:59:00 EST 2004


On Monday 05 January 2004 01:11 pm, Christopher A. Craig wrote:
> Or they are both the position of the start of the element from the
> start or end of the list. 

And this is perfectly symmetrical.  Which is why I find
Python's indexing and slicing more intuitive than any
of its predecessors.

I think the "half open interval" notion mentioned above is
equally useful.  Note that both are related to "real number
thinking" and not "integer thinking": i.e. they are distances
or positions, not "numbers of things".

BTW, I think this is more on-topic for the list --- this is the
way to teach Python indexing: as "distances".

Cheers,
Terry

--
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks  http://www.anansispaceworks.com



More information about the Edu-sig mailing list