Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #!/usr/bin/python
  2. file=open("C:/python27/python operators.txt","r+")
  3.  
  4. wordcount={}
  5.  
  6. for word in file.read().split():
  7. if word not in wordcount:
  8. wordcount[word] = 1
  9. else:
  10. wordcount[word] += 1
  11.  
  12. for k,v in wordcount.items():
  13. print k, v
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement