Slicing and offsets

gustabares at my-deja.com gustabares at my-deja.com
Wed Jan 17 19:05:19 EST 2001


 I got a newbie question here...

>>> S = "spam"
>>> S[0]
's'
>>> S[1:]
'pam'
>>>

Why is it that when I slice S it's no longer the 0 offset anymore, but
now it is 1?

>>> S[0:]
'spam'

Thanks for any help and sorry for the simple question:)

Gus Tabares



Sent via Deja.com
http://www.deja.com/



More information about the Python-list mailing list