''' Purpose: spell check a line of input ''' # import get module for url supoprt import url # define link for spelling dictionary WORDS_FOLDER_URL = 'http://www.cs.virginia.edu/~cs1112/datasets/words/' SPELLING_LIST_URL = WORDS_FOLDER_URL + 'spellings' # get the spelling list as a list of words spellings = url.get_strings( SPELLING_LIST_URL ) # get the user text as a list of words reply = input( 'Enter text: ' ) reply = reply.lower() words = reply.split() # consider the user words one by -- determine whether word is misspelled. for word in words : # I'm looking at each word in turn if word not in spellings : # If the word is in spellings, it's a correctly spelled word print( word ) # all done