Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Big Data Hadoop & Spark by (19k 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!

Browse Categories

...