cannot import name 'counter' from 'collections' 1

cannot import name ‘counter’ from ‘collections’

from collections import Counter
#be sure that the C letter of Counter is a capital letter.

Here is what the above code is Doing:
1. We’re creating a Counter object, which is a dictionary that stores the number of occurrences of each item.
2. We’re looping through each word in the list of words.
3. We’re adding each word to the Counter object.
4. We’re printing the 10 most common words.

Similar Posts