I have a simple word jumble game. I made the jumble already, but now I want to add a 'hint' system. I don't know how to have 1 item from tuples show up. I have 2 tuples, and I want to pull from the 2nd tuple based on the what the first tuple is. I have a WORD=("x", "y", "z")
and HINT=("x", "y", "z")
. When the user enters "hint"
, I want the program to return the corresponding value from HINT
. I tried:
for h in HINT:
if guess=="hint":
print h
Obviously, this doesn't work, and just prints all of the HINT values.
If I had:
hints=dict(zip(WORDS, HINT))
if guess=="hint":
print "Here's a hint:", hints[correct]
while (guess !=correct) and (guess != ""):
print "Sorry, that's not the answer."
guess=raw_input("Your guess: ")
guess=guess.lower()
if guess==correct:
print "That's it! You guessed it!\n"
print "Thanks for playing."
would there be any way for me to make it NOT print "Sorry, that's not it."? (also, 'correct' here is the word)