[Edu-sig] Re: Confusion with slice notation

Trent Oliphant trent at oliphant.org
Mon Jan 5 17:43:42 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".

I would tend to agree that using "distances" is a very powerful method 
for teaching indexing and slicing in Python.  I think that it lends 
itself very well to understanding what the compuuter is actually doing, 
as illustrated by Christopher's explanation.  Every item in the list 
does indeed have a "size" (in memory) but in practice, it is an 
indivisible size of 1.

However, as Kirby points out, this isn't the only appropriate way to 
teach it.  Some people would actually be confused by the model.

If this list is truly about bringing about the goals of CP4E, then we 
need to discuss more these types of issues with learning specific 
concepts.  We had a little bit of discussion like this with the using 
calculator vs. spreadsheet discussion.  However, I'm not sure we ever 
really discussed how different learning styles come into play with 
teaching computer literacy.

Besides the issue of learning styles, you have the whole issue of 
computer "readiness" - specific background information - that will 
differ from person to person.

I do want to thank everyone for their input, I think I finally "get it" 
now, although I will only be able to know for sure the next time I go to 
do some reverse indexing on a list.


More information about the Edu-sig mailing list