According to documentation strip method removes heading and trailing characters.
Why then: txt = ",,,,,rrttggs...,..s,bananas...s.rrr" x = txt.strip(",s.grt") print(x) output: banana 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 -- https://mail.python.org/mailman/listinfo/python-list