Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

what is the next line? >>> tuplea = (5, 20, 30, 40, 30) >>> tuplea.inde…

Question

what is the next line?

>> tuplea = (5, 20, 30, 40, 30)
>> tuplea.index(30)

0
1
3
2

Explanation:

Step1: Understand tuple index method

The index() method of a tuple in Python returns the index of the first occurrence of the specified element.

Step2: Locate first - occurring 30

In the tuple tupleA=(5, 20, 30, 40, 30), the first 30 is at index 2 (since indexing starts from 0).

Answer:

2