Q:

How to get my program to check for more than one letter in a word

I have a program here that's supposed to check the users input, compare with actual word, and print out how much of the actual word the user has found. My problem, though, comes when the user enters a letter which occurs more than once in the word.
position = []
word = "elephant"
letter = input("Please enter a letter: ")

for letter in word:
    position.append("_")
if letter in word:
    position[word.index(letter)] = letter
    print("".join(position))

In this case if I entered an "e" the program would output e_______ though what I would want is e_e____. Thank you.

A:

Check in the for loop: 
for char in word: # don't use 'letter' again
    if char == letter:
        position.append(char)
    else:
        position.append('_')

As a list comprehension:
position = [char if char == letter else '_' for char in word]

