Report Bug
Qus :

What will be the output of the following Python code?

example = "NITIN"
print(example.rfind("N"))

Qus

निम्नलिखित Python कोड का आउटपुट क्या होगा?

example = "NITIN"
print(example.rfind("N"))


A. -1
B. 4
C. 3
D. 1


Solution
B. 4



Explanation
<p><span style="font-size: 14px;">The rfind() method is used with strings to find the highest (rightmost) index of a substring.</span></p><p><span style="font-size: 14px;">If the substring is not found, it returns -1.</span></p>



Report Bug