I want to find the position (or index) of the last occurrence of a certain substring in given input string str.
str
For example, suppose the input string is
Try this:
s = 'hello plombier pantin' print (s.find('p')) 6 print (s.index('p')) 6 print (s.rindex('p')) 15 print (s.rfind('p'))