Removes the specified set of characters from the right of the source string as long as a match is found.
str = 'You say tomato, I say tomato, the French say tomate.' print(str.rstrip('apples.')) # the e and . are the match the last two characters in the source string.
You say tomato, I say tomato, the French say tomat