Q:

Finding the index by searching for a string in a list

I am currently reading "Python Programming for the Absolute Beginner ed 3" and I have a question about one of the challenges.
I am creating a Word Jumble game that will pick a word from a list or tuple, jumble the word and ask the user to guess the word.
# Word Jumble

# The computer picks a random word and then "jumbles" it
# The player has to guess the original word

import random

# Create a sequence of words to choose from 
WORDS = ("python", "jumble", "easy", "difficulty", "answer", "xylophone")

# Pick one word randomly from the sequence
word = random.choice(WORDS)

# Create a variable to use later to see if the guess is correct
correct = word

# Create a jumbled version of the word
jumble = ""
while word:
    position = random.randrange(len(word))
    jumble += word[position]
    word = word[:position] + word[(position + 1):]

# Start the game
print(    
"""
           Welcome to Word Jumble!

    Unscramble the letters to make a word.
 (Press the enter key at the prompt to quit.)
""")
print("The jumble is:", jumble)

guess = input("\nYour guess: ")
while guess != correct and guess != "":
    print("Sorry, that's not it.")
    guess = input("Your guess: ")

if guess == correct:
    print("That's it!  You guessed it!\n")

print("Thanks for playing!")
input("\n\nPress the enter key to exit.")

This is the original code from the book.  The challenge was to implement a hint and scoring system into the game.  I had an idea of creating another tuple respective to the WORDS tuple and have the hints there.  IE:
hints = ("*insert hint for python*",
         "*insert hint for jumble*",
         "*insert hint for easy*",
         "*insert hint for difficulty*",
         "*insert hint for answer*",
         "*insert hint for xylophone*")

What I wanted to do was find the index of the random.choice word, so this is what I tried.
index = word.index(WORDS)
print(index)

I was thinking this would come back with the integer for the WORDS tuple and allow me to print hints using:
print(hints[index])

However, I was mistaken.  Is this possible?  I got it to work, however it was a long list of if, elif statements such as:
if guess == "hint" or guess == "Hint" or guess == "HINT":
    if hint == "python":
        print(HINTS[0])

I know some may say, "Why don't you just stick with this since it works?"  I know I can do this, but the point of me learning python or programming in general is to know how to accomplish set tasks in a variety of ways.
--This part is secondary and doesn't need a response, unless you want to--
Also my scoring system is as follows, in case anyone has thoughts on how it can be improved or if it is done well.
The idea is your score starts out at 100, if you use a hint you lose 50% of your total score.  Each guess removes 10 points off of the total score.  If your score reaches a negative number, it will be set to 0.  Here is how I did it.
score = 100
guesses = 1

This is added after a hint is used.
score //= 2

After a guess is made.
guesses += 1

Finally if the guess is correct.
if guess == correct:
print("That's it!  You guessed it!\n")
score = score - (guesses - 1) * 10
if score <= 0:
    score = 0
print("\nYour score is: ", score)

As always, any help is greatly appreciated.

A:

If you have:
>>> WORDS = ("python", "jumble", "easy", "difficulty", "answer", "xylophone")

And you use the index method, you get back the numeric position of that word in the list:
>>> WORDS.index('easy')
2

And similarly:
>>> word = random.choice(WORDS)
>>> word
'answer'
>>> WORDS[WORDS.index(word)]
'answer'

You've suggested in your question that you're seeing some behavior that doesn't make sense.  If you think you're doing something largely similar to what I've illustrated here, it would help if you could update your question with a specific example showing (a) what you expect to be getting, (b) what you're actually getting, and (c) any errors encountered along the way.

