Count Occurrences in Tuple

Write a function count_occurrences that takes a tuple and an element. The function should return the number of times the element appears in the tuple.
def count_occurrences(tpl, element):
# complete function here...
print(count_occurrences((1, 2, 3, 2, 2, 4), 2)) # expected output: 3 print(count_occurrences((3, 3, 3, 3, 3, 4), 3)) # expected output: 5 print(count_occurrences(('a', 'b', 'c', 'd', 'c', 'b'), 'b')) # expected output: 2
Python
Setting up Python environment...
Output