file_spellcheck = input("Name of the document to be spell-checked: ") with open(file_spellcheck, "r") as i: spellchecking = i.read() for item in spellchecking: items = item.split() if items in with open("file.out", "w") as i: i.write()
I need to make a spell checker that uses another file as a dictionary. So let's say the dictionary is words.dat, then the user is prompted to name a document to spell check. User enters a document to spell check, but the program should prompt the user with the word that is spelled incorrectly to either replace, replace all, ignore, ignore all or exit.
I got stuck as to where to go with the if statement.