Getting last char in string.

Alex Martelli aleax at aleax.it
Thu Sep 26 13:50:46 CEST 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