pretty strange behavior of "strip" FORGET THE LAST ONE

Scott David Daniels Scott.Daniels at Acm.Org
Fri Dec 5 12:12:58 EST 2008


Guy Doune wrote:
> 
> 
> Guy Doune a écrit :
>> Ok, didn't show the whole problem...
>>
>> I will read the doc anyway, but why "questions.html" keep it "t"??
>>
>> >>> test=['03.html', '06.html', 'questions.html', '04.html', 
>> 'toc.html', '01.html', '05.html', '07.html', '02.html', '08.html']
>> >>> test[4]
>> 'toc.html'
>> >>> test[4].strip('.html')
>> 'oc'
>> >>> test[2].strip('.html')
>> 'questions'

Well, why does '  a b c  '.strip() leave two spaces?

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list