#HOW_TO_1.PY     Get user input

import random
import sys
import os

#define word for ryming

target = "blue"

#create a list of ryming words:
#Google found 610 words...
rhymer_list = [
"queue","flu","bleu","lieu","through",
"rew","flue","blew","liu","thru",
"rhew","foo","boo","loo","to",
"rhue","frew","brew","lue","too",
"rue","glew","brue","mew","true",
"schewe","glue","chew","moo","tu",
"schoo","gnu","chiu","mu","two",
"screw","goo","clue","new","u",
"shoe","grew","crew","nu","u.",
"shoo","hew","cue","ooh","uwe",
"shrew","hewe","deux","oooh","view",
"sioux","hoo","dew","pew","vous",
"skew","hue","do","phew","whew",
"slew","jew","doo","poo","who",
"soo","jus","drew","pooh","woo",
"spew","kew","drough","pshew","wu",
"sprew","knew","due","pugh","yew",
"stew","koo","ewe","q","yoo",
"strew","leu","few","que","yue",
"threw","lew","flew","zue","zhou",
"zhu","zoo"
       ]
end_loop = "False"

while (end_loop == "False"):
    #prompt the user to enter something:
    print("Enter a word that rhymes with ",target, " : ", end="")

    #get value from user
    guess = sys.stdin.readline()

    print("\nYou entered ; ",guess)

    #to remove the trailing "\n",  use rstrip()
    guess = guess.rstrip()

    if ( guess in rhymer_list ):
        end_loop = "True"
    else:
        print("The word ",guess, " is not in our list of words that rhyme with ",target,".\n")

print ("\nCongratulations !,", guess, "was in our list of words that rhyme with ",target,"\n")
