Q:

Counts the number of occurrences of item 50 from a tuple using python programming

0

Counts the number of occurrences of item 50 from a tuple

Given:

tuple1 = (50, 10, 60, 70, 50)

Expected output:

2

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Hint:

Use the count() method of a tuple.

Solution:

tuple1 = (50, 10, 60, 70, 50)
print(tuple1.count(50))

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now