f = file('/usr/share/dict/words') words = [] for i in f: words.append(i.strip().lower()) def find(w, words): for i in xrange(len(words)): if w == words[i]: print "found in", i return print "not found" while 1: w = raw_input('word? ') if not w: break find(w, words)