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

1 Answer

0 votes
by (32.4k 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!

...