निम्नलिखित का आउटपुट क्या होगा पायथन कोड?
What will be the output of the following Python code ?
example = “helle”
example.rfind(“e”) A
1
B
2
C
4
D
5
Explanation
Let's break down the code:
example = "helle"
example.rfind("e")
rfind()returns the highest index of the substring (in this case,"e") found in the string.- In the string
"helle", the last occurrence of"e"is at index4.
So, the output will be 4.
Answer: (C) 4.
Correct Answer: C) 4