adplus-dvertising
frame-decoration

Question

What is the output of the following 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)

a.

5

b.

3

c.

4

d.

0

Posted under Python

Answer: (c).4

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of the following code?