rfind() - Searches the string for a specified value and returns the last position of where it was found

Returns the index of the last occurrence found of the specified substring.  Python will return -1 if the search string is not found.

Example

Python
str = 'Hello World'
print(str.rfind('o'))
print(str.rfind('q'))

Output

7
-1