write a program to find the occurrence of given element (tuple python)
Answers
Answered by
0
Answer:
s first see an example to count the occurrence of 2 in the tuple.
# Python tuple count() Method.
# Creating a dictionary.
data = (2,4,6,8,10) # Tuple of even numbers.
print(data)
# Calling Method.
count = data.count(2)
print("Occurences:",count)
data = (2,4,6,8,10,2)
Similar questions