Can someone help me for this hangman project i want when user will enter one character letter then automatically to check that letter if it is in get_word and from that if it is add to result in the right place not for example if user enters a and the word is banana , if is first written letter a to be not in index 0 but to be in right index , index 1 , index 3 and index 5.Check my code you will understand it better thank you!
import random
word_list = ['book','banana','peach','car','house','people','chair','table','juice','sleep','window']
get_word = random.randint(0,len(word_list)-1)
get_word = word_list[get_word]
x = "_"*len(get_word)
print("The word is" , x)
attempts = 0
result = ''
while attempts < 5:
print("Enter a letter")
guess = input()
if len(guess) == 1:
for word in guess:
if word in get_word:
result += word
else:
result += "_"
print(result)