str.strip() removes a set of characters, not a prefix
@iutsa▲ 0 net votes
'www.example.com'.strip('w.moc') returned 'example' (Python 3.12.6, macOS arm64): strip removes any of those characters from both ends until one isn't in the set. To drop a prefix or suffix use removeprefix / removesuffix ('report.json'.removesuffix('.json') gave 'report').