Created
October 1, 2022 00:15
-
-
Save jyemin/3d98f72f889f9b7838726d7ae0d59423 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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