Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

what is the next line? >>> tupleb = (5, 7, 5, 10, 2, 7) >>> tupleb.coun…

Question

what is the next line?

>> tupleb = (5, 7, 5, 10, 2, 7)
>> tupleb.count(7)

1
5
0
2

Explanation:

Step1: Understand count method

The count method in Python for tuples counts the number of occurrences of a specified element.

Step2: Count occurrences of 7

In the tuple tupleB=(5, 7, 5, 10, 2, 7), the number 7 appears 2 times.

Answer:

D. 2