Design for slices

Ben Catanzariti fakeaddress at nospammail.com
Wed Jan 31 17:54:55 EST 2001


I am fairly sure this came about due to the fact you are defining a position
of a pointer, not an object ie. a letter in a string. So position x[0] means
the pointer has not moved or has a null value and will occur directly before
the first letter in a string....

Some one please correct me if i am wrong ... I am sure you will ;)

"Gustaf Liljegren" <gustafl at algonet.se> wrote in message
news:959uue$k02$1 at cubacola.tninet.se...
> I'm learning Python and have a question about defining ranges/slices in
> strings. I can't find any defence for what looks like a poor design, so I
> have to ask. Why is the first character in the string x defined as x[0]
and
> not x[1]? This looks just like the typical geek thinking that I'm trying
to
> avoid with Python.
>
> Gustaf





More information about the Python-list mailing list