Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/python
- intrare = open('cur','r')
- iesire = open ('altcur','w')
- wordcount = {}
- for word in intrare.read().split():
- if word not in wordcount:
- wordcount[word] = 1
- else:
- wordcount[word] += 1
- iesire.write(str(wordcount))
- intrare.close()
- iesire.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement