Concept

count(x)

The built-in function returns the number of times an element with the value x appears in the list.

Note: If several element types are used in a list, 1 evaluates to True, so calling count(1) or count(True) counts the number of appearances of both 1's and True's. Likewise for 0's and False's.

Image 0

0

1

Updated 2021-05-19

Tags

Python Programming Language

Data Science