When working with strip, lstrip, or rstrip, you might think that this would be the case:
>>> "Monty Python".rstrip(" Python")
"Monty""M"If you want to remove a prefix/suffix from a string, str.removeprefix and str.removesuffix are recommended and were added in 3.9.
>>> "Monty Python".removesuffix(" Python")
"Monty"