How to count the occurrences of specific element in a tuple with Python

1 Answer

0 votes
tpl = ('a', 'b', 'c', 'a', 'a', 'c', 'd', 'e', 'f', 'f')

count = tpl.count('a')

print(count)



'''
run:

3

'''

 



answered Dec 10, 2019 by avibootz

Related questions

...