0 votes
1 view
in Big Data Hadoop & Spark by (13.5k points)
Is there a function in Python that counts the number of occurrences of an item in Python?

1 Answer

0 votes
by (33.1k points)

You can count() method in Python:

>>> [1,1,2,3,5,6,8,6,3,2,4].count(3)

Output: 2

Hope this answer helps you!

Welcome to Intellipaat Community. Get your technical queries answered by top developers !