[Tutor] String method "strip()" not working

Alan Gauld alan.gauld at btinternet.com
Sat Mar 7 17:38:24 CET 2015


On 07/03/15 15:17, Mark Lawrence wrote:

>>      S.strip([chars]) -> string or unicode
>>
>>      Return a copy of the string S with leading and trailing
>>      whitespace removed.
>>      If chars is given and not None, remove characters in chars instead.
>>      If chars is unicode, S will be converted to unicode before stripping
>
> Presumably Python 2 (or earlier Python 3) help output.  In Python 3
> strings are always unicode, so that last line has gone.

Good catch, especially since the OP specifically said v3.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list