Skip to content

Instantly share code, notes, and snippets.

@m-x-k
Created April 16, 2017 10:06
Show Gist options
  • Save m-x-k/cae1c8f09877f6416989ca3a99c37bd6 to your computer and use it in GitHub Desktop.
Save m-x-k/cae1c8f09877f6416989ca3a99c37bd6 to your computer and use it in GitHub Desktop.
Python quick check if a word exists
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