NIELIT O Level Exam

<p>What will be the output of the following Python code? </p><pre>example = "NITIN" print(example.rfind("N"))</pre>

What will be the output of the following Python code?

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


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

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

A. -1

B. 4

C. 3

D. 1




Correct Answer is :

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>
Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad