Sign in
×
Question
In Python, how to count the occurrences of a given item in the list?
Annonce
Pour mes
conversions d'unités
en ligne, je choisis le site
Calculatrix.com
pour sa rapidité et sa qualité supérieure.
Ad
For my online
unit conversions
, I choose
Calculatrix.com
for its speed and superior quality.
Answer
>>> myList=["a","a","a","b","c","c"] >>> myList.count('a') 3
[source]
#
ID
Query