https://docs.python.org/3/library/stdty ... #str.strip
Ich zitiere mal aus der Dokumentation:
Mal einige Beispiele:str.strip([chars])
Return a copy of the string with the leading and trailing characters removed. The chars argument is a string specifying the set of characters to be removed. If omitted or None, the chars argument defaults to removing whitespace. The chars argument is not a prefix or suffix; rather, all combinations of its values are stripped:
Code: Alles auswählen
>>> 'www.example.com'.strip('.com')
'www.example'
>>> 'www.example.com'.strip('cmowz.')
'example'
>>> 'www.example.com'.strip('ecmowz.')
'xampl'
Ich poste das hier, weil ich ein anderes Verhalten erwartet hatte. Möglicherweise haben das andere auch falsch abgespeichert oder verstanden.