Getting last char in string.

Alex Martelli aleax at
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.


More information about the Python-list mailing list