How to remove the last character from a string in Python by using the rstrip method