# # Torbert, 8.20.2008 # # Spell-checker, Version 1.0 # # Input: dictionary of six-letter words and a string entered by the user # Process: determine if the user's string is a word in the dictionary # Output: indicate YES or NO # wlist=open('words.txt').read().split('\n')[:-1] # emoticon is like chomp ustr=raw_input('String: ') if ustr in wlist: print 'Yes, %s is a word.' % (ustr) # similar to printf else: print 'No, %s is not a word.' % (ustr) print 'Done!' # # Notes # ----- # This version uses the "in" command to determine list membership. #