# Count the Number of Times an Item Appears in a List – Python

Here are 3 ways to count the number of times an item appears in a list in Python:

(1) Using count() to count a specific item. For example, let’s count the number of times ‘mm’ appears in a list:

```my_list = ['mm', 'bb', 'cc', 'mm', 'mm', 'cc']

count_item = my_list.count('mm')

print(count_item)
```

The result is 3 times:

``````3
``````

(2) Using Counter to count a specific item. Let’s again count the number of times ‘mm’ appears in a list:

```from collections import Counter

my_list = ['mm', 'bb', 'cc', 'mm', 'mm', 'cc']

count_all = Counter(my_list)
count_item = count_all.get('mm')

print(count_item)
```

The result is the same:

``````3
``````

(3) Using Counter to count the number of times each item appears in a list:

```from collections import Counter

my_list = ['mm', 'bb', 'cc', 'mm', 'mm', 'cc']

count_all = Counter(my_list)

print(count_all)
```

Here you’ll get the number of times that each item appears in a list:

``````Counter({'mm': 3, 'cc': 2, 'bb': 1})
``````
{"ft_lang_label":"__label__en","ft_lang_prob":0.70825934,"math_prob":0.9471726,"size":916,"snap":"2023-40-2023-50","text_gpt3_token_len":262,"char_repetition_ratio":0.16666667,"word_repetition_ratio":0.37583894,"special_character_ratio":0.32751092,"punctuation_ratio":0.16753927,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9901977,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-10-01T23:10:46Z\",\"WARC-Record-ID\":\"<urn:uuid:6c641a55-12f3-464f-9d66-9047938e5835>\",\"Content-Length\":\"43943\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:f52241ec-3ecc-49ea-a304-d8a407c445bf>\",\"WARC-Concurrent-To\":\"<urn:uuid:95c9d905-6a78-4d46-89de-42d99bcf4597>\",\"WARC-IP-Address\":\"67.227.251.157\",\"WARC-Target-URI\":\"https://datatofish.com/count-items-list-python/\",\"WARC-Payload-Digest\":\"sha1:7VFAEH6LHELBXX7AELGRMZ3UGX7RILZL\",\"WARC-Block-Digest\":\"sha1:T5AX5IBGATIRFD6ZSS3P63MHUFTJXAY4\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-40/CC-MAIN-2023-40_segments_1695233510941.58_warc_CC-MAIN-20231001205332-20231001235332-00718.warc.gz\"}"}