Skip to content

Instantly share code, notes, and snippets.

@jyemin
Created October 1, 2022 00:15
Show Gist options
  • Save jyemin/3d98f72f889f9b7838726d7ae0d59423 to your computer and use it in GitHub Desktop.
Save jyemin/3d98f72f889f9b7838726d7ae0d59423 to your computer and use it in GitHub Desktop.
dictionary = open('/usr/share/dict/words')
letters = ['n', 'j', 'u', 'l', 'r', 'o', 'a']
center = 'a'
def contains_bad_letters(word):
for letter in word:
if letter not in letters:
return True
return False
def pangram(word):
if len(word) < 7:
return False
for letter in letters:
if letter not in word:
return False
return True
for word in dictionary:
word = word[:-1]
if len(word) < 4:
continue
if word[0].isupper():
continue
if center not in word:
continue
if contains_bad_letters(word):
continue
if pangram(word):
print('*', end='')
print(word)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment