#!/usr/bin/python #using a Dictionary even though don't need the lookup pair because #I'm guessing that its internal searching will be faster than using a list dict = { } #initialize dictionary dictf = open('dict.txt') for word in dictf: word = word.strip() dict[word]='1' def isindict (word): return dict.get(word,0) or dict.get(word.lower(),0)