Skip to content

Instantly share code, notes, and snippets.

@hyonschu
Created December 13, 2013 00:42
Show Gist options
  • Save hyonschu/7938249 to your computer and use it in GitHub Desktop.
Save hyonschu/7938249 to your computer and use it in GitHub Desktop.
def wordcount(filename):
f=open(filename)
line = f.readline()
for word in line:
if word in dic:
dic[word] += 1
else:
dic[word] =1
return dic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment