let's say rand_word is string = 'petite'
and guess is a user input of a single char
for char in rand_word:
if char in guess:
print(char,end='')
else:
print('_',end="")
in the code above if I typed the letter 'e' as my input it will output this
_e___e
My problem is how do I put this output in a variable?