Question

In Python, how to count the occurrences of a given item in the list?


Annonce
Ad

Answer

>>> myList=["a","a","a","b","c","c"]
>>> myList.count('a')
3


[source]
# ID Query