निम्नलिखित का आउटपुट क्या होगा पायथन कोड?
What will be the output of the following Python code ?
example = “helle”
example.rfind(“e”)
A)
B)
C)
D)
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.