How do you count repeated words in a list in Python?

Python Feature Image

In this post, we will talk about how to count repeated words in python list. It can be done in many ways.

Using collections.Counter()

# Importing counter function. 
from collections import Counter 
words = ["a", "b", "a", "c", "c", "a", "c"] 
duplicate_dict = Counter(words) 
print(duplicate_dict)#to get occurence of each of the element. 
print(duplicate_dict['a'])# to get occurence of specific element.


Counter({‘a’: 3, ‘c’: 3, ‘b’: 1})


  • Using count()
letter = ["b", "a", "a", "c", "b", "a", "c",'a'] 


> 4

Hope this helps!

Important Notice for college students

If you’re a college student and have skills in programming languages, Want to earn through blogging? Mail us at

For more Programming related blogs Visit Us Geekycodes. Follow us on Instagram.

By geekycodesco

Leave a Reply

%d bloggers like this: