Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # #!/usr/bin/python
- #
- # By dvdjaco
- # Exercise 8.4
- #
- fhand = open('romeo.txt')
- wordlist = []
- for line in fhand:
- words = line.split()
- for word in words:
- word = str.lower(word) #lowercase strings before comparing
- if word in wordlist: continue
- wordlist.append(word)
- wordlist.sort()
- print wordlist
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement