Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from itertools import chain
- dictionary=open("Scrabble.txt").read().split('n')
- import re,string
- #after replacing the word with "_", we find words in the dictionary that match the pattern
- def wordshape(word):
- new=[]
- for letter in string.ascii_lowercase:
- underscore=re.sub('_', letter, word)
- if underscore in dictionary:
- new.append(underscore)
- if new == []:
- pass
- else:
- return new
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement