This is a story about a sailor and a whale called Moby Dick
words = set((str.upper(file('c:/tmp/story.txt').read())).split()) print words
set(['A', 'AND', 'STORY', 'THIS', 'IS', 'DICK', 'ABOUT', 'SAILOR', 'MOBY', 'WHALE', 'CALLED'])
No comments:
Post a Comment