Created
April 16, 2017 10:06
-
-
Save m-x-k/cae1c8f09877f6416989ca3a99c37bd6 to your computer and use it in GitHub Desktop.
Python quick check if a word exists
This file contains hidden or 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
import string | |
def is_word(match): | |
for word in open('/usr/share/dict/words', 'r'): | |
if str(word.strip().lower()) == str(match.lower()): | |
return True | |
return False | |
print(is_word("abacus")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment