str.rfind()


Definition
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].

Syntax
str.rfind(sub[, start[, end]]) -> int

Parameters
str=string
start, end=string

Examples
The output is:
 >>> "python".rfind("on")
4

The equal to:
 >>> "Python Research Centre".rfind("Centre")
16
>>> type("Python Research Centre".rfind("Centre"))
<class 'int'>
>>> str("Python Research Centre".rfind("Centre"))
'16'
>>> type(str("Python Research Centre".rfind("Centre")))
<class 'str'>

str(int()) not equal int(str())
The returns are :
 >>> type("Python Research Centre".rfind("Centre"))==type(str("Python Research Centre".rfind("Centre")))
False
>>> type("Python Research Centre".rfind("Centre")) is not type(str("Python Research Centre".rfind("Centre")))
True
>>> "Python Research Centre".rfind("Centre") is not str(int("Python Research Centre".rfind("Centre")))
True
>>> "Python Research Centre".rfind("Centre").__eq__str(int("Python Research Centre".rfind("Centre")))
False
>>> "Python Research Centre".rfind("Centre") .__eq__int(str("Python Research Centre".rfind("Centre")))
True
>>>

Comments