words = [] def setdict(dictionary): dict = open(dictionary) word = "holder" while word: word = dict.readline().strip() words.append(word) dict.close() def isindict(word): return lookup(word) def lookup(word): if word in words: return 1 elif word.lower() in words: return 1 else: return 0 setdict("dict.txt")