newbie string question

Jeff Sandys sandysj at juno.com
Fri Jun 21 12:34:55 EDT 2002


Other good replies already.
My metaphor: Fence posts and panels.
(A 50 foot fence using 10 foot panels has 6 fence posts and 5 panels)
The fence post problem is common in computational math.

Don Low wrote:
> 
> There's probably a very simple explanation, 
> but I can't see it for now, so bear with me.
> 
> >>>pystr = 'Python'
> >>>pystr = [5]
> 'n'
> >>>pystr [2:5]
> 'tho'
> 
> The question is, why isn't pystr [2:5] 'thon' instead of 'tho'. 
> Could somebody explain?



More information about the Python-list mailing list