-
Notifications
You must be signed in to change notification settings - Fork 20
Joy of Python
Jeff Schnitzer edited this page Mar 12, 2017
·
1 revision
# first: grep '^......$' /usr/share/dict/words > words
f = open('words')
lines = f.readlines()
lines = [line.strip().lower() for line in lines]
letters = 'ecmlobkidepx'
def hasall(line):
llist = list(letters)
for letter in list(line):
try:
llist.remove(letter)
except:
return False
return True
for line in lines:
if hasall(line):
print(line)
Can you guess what game I'm playing?