strip() method makes me confused

Frank Millman frank at chagford.com
Sat Nov 7 06:34:29 EST 2020


On 2020-11-07 1:28 PM, Frank Millman wrote:
> On 2020-11-07 1:03 PM, Bischoop wrote:
>>
[...]
>>
>> another example:
>>
>> text = "this is text, there should be not commas, but as you see there
>> are still"
>> y = txt.strip(",")
>> print(text)
>>
>> output:
>> this is text, there should be not commas, but as you see there are still
>>
> 

P.S. If you wanted to remove all the commas, you could do it like this -

y = txt.replace(',', '')

Frank



More information about the Python-list mailing list