# python demo script to illustrate dictionary usage to replace words in a sentenceInput is word pairs exactly with same whitespaces as here:
Hi Hello Thanks Thank-you Bye Goodbye
(one space between pairs, two spaces between every pairs)In a user's input sentence example as follows:
Hi there, Thanks, Bye
using the above given pairs as a dictionary to replace corresponding words in the input sentence, and the output becomes:Hello there, Thank-you, Goodbye
Read input from user, first word pairs, then the sentence, split, loop over elements to replace what's entered from pair words into entered sentence.Comments are very important so I can understand. Thanks
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here