Spelling program. - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Spelling program. (/thread-18265.html) |
Spelling program. - GalaxyCoyote - May-11-2019 I'm trying to create a program that checks your spelling. It will ask the user what word they want to spell and then they will type it out, this isn't a project I'm serious about as I'm just trying to learn how something like this would work, but my dad suggested that I add a feature where it would check the letters in the input and tell you how many you got right. How would I go around doing something like this? Word = 0 Answer = 0 Correct = 0 Incorrect = 0 Loop = True IfLoop = 0 while Loop: print("Choose a word.") Word = input("") print(f"Spell {Word}") Answer = input("") if Answer == Word: print("Correct! Well done!") Correct = Correct + 1 print(f"Correct:{Correct}\nIncorrect:{Incorrect}") elif Answer != Word: print("Incorrect...") Incorrect = Incorrect + 1 print(f"Correct:{Correct}\nIncorrect:{Incorrect}") IfLoop = int(input("Do you want to go again?\n1)Yes\n2)No\n")) if IfLoop == 1: Loop = True elif IfLoop == 2: Loop = False RE: Spelling program. - Larz60+ - May-11-2019 You might want to do this using a package like NLTK which can give all possible spellings and select one from sentence context. https://www.nltk.org/ RE: Spelling program. - GalaxyCoyote - May-11-2019 (May-11-2019, 02:54 PM)Larz60+ Wrote: You might want to do this using a package like NLTK which can give all possible spellings and select one from sentence context. https://www.nltk.org/ Thanks! |