Report Bug

Qus: <p>What will be the output of the following Python code?</p><pre>myList = [1, 5, 5, 5, 5, 1]<br>max = myList[0]<br>indexOfMax = 0<br>for i in range(1, len(myList)):<br>&nbsp; &nbsp; if myList[i] &gt; max:<br>&nbsp; &nbsp; &nbsp; &nbsp; max = myList[i]<br>&nbsp; &nbsp; &nbsp; &nbsp; indexOfMax = i&nbsp; &nbsp;<br>print(indexOfMax)</pre>

Qus<p>निम्नलिखित Python कोड का आउटपुट क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;">myList = [1, 5, 5, 5, 5, 1]<br>max = myList[0]<br>indexOfMax = 0<br>for i in range(1, len(myList)):<br>&nbsp; &nbsp; if myList[i] &gt; max:<br>&nbsp; &nbsp; &nbsp; &nbsp; max = myList[i]<br>&nbsp; &nbsp; &nbsp; &nbsp; indexOfMax = i&nbsp; &nbsp;<br>print(indexOfMax)</pre>


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


Solution
A. 1



Explanation
First time the highest number is encountered is at index 1.
Latest Current Affairs 2026 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test , CCC MCQ Python Coding Tutorials Best Computer Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Website development Company in Allahabad