rpartition() - Returns a tuple where the string is parted into three parts

Searches the source string from the right for the first match of the specified substring and returns a tuple with everything to the left of the match (from the right), the match, and everything to the right of the first match (again, from the right.)

Example

Python
str = 'You say tomato, I say tomato, the French say tomate.'
print(str.rpartition('tomato'))

Output

('You say tomato, I say ', 'tomato', ', the French say tomate.')