Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 369 Bytes

README.md

File metadata and controls

11 lines (8 loc) · 369 Bytes

Python function to count tuple elements

Suppose you are given a tuple containing ints and strings. Write a Python function to return the # of times a given element, n, appears in the tuple.

For example, given the tuple below, where n=3, your function should return 4, since 3 appears 4 times in the tuple.

my_tuple = 2, 'my_string', 4, 3, 3, 3, 2, 3