Getting last char in string.

Alex Martelli aleax at aleax.it
Thu Sep 26 07:50:46 EDT 2002


CheapSkate wrote:
        ...
> if s[-1] returns a single element, why woulnd't it return " ?
> Single character are strings of length 1(as u said) and " is single
> character right?

Nope: '', the empty string, is 0 characters, not 1 character.


Alex




More information about the Python-list mailing list