wordcount.py

1
2
3
4
5
6
7
import re
from collections import Counter


def word_count(words):
    words = re.sub(r'[\W_]+', ' ', words.lower()).split()
    return Counter(words)

@Xen-Ka thinks this looks great

Comments

Updated solution since it seems to have changed a bit since I did it!

helenst commented 3 May 2016 at 17:17 UTC

You're not logged in right now. Please login via GitHub to comment