The Python Rindex method is one of the Python String Method which is used to return the index position of the last occurrence of a specified string. It will return ValueError, if the specified string is not found.
Syntax
String.rindex(sub,start,end)
Parameters
subRequired. The value to search for
start Optional. Where to start the search. Default is 0
endOptional. Where to end the search. Default is to the end of the string.