Report Bug

Qus

What will be the output of the following Python code?

  a = [1, 5, 7, 9, 9, 1]  <br class="blank" />b=a[0]  <br class="blank" />x= 0  for x in range(1, len(a)):      if a[x] > b:          b = a[x]          b= x  print(b)
Qusनिम्नलिखित Python कोड का आउटपुट क्या होगा?


A. 5
B. 3
C. 4
D. 0


Solution
C. 4



Explanation
The above piece of code basically prints the index of the largest element in the list.
CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad