Basic hangman code-problem with changing the word after right answer : <p>My code does not work properly. All I want is to make the word appear properly without any additional messages. What am I doing wrong? For simplicity, I just put one word ('weekend') so that I can easily check my code's mistakes every time I run it.</p>

<pre><code>def hangman():
    j=0
    word='weekend'
    new_word=len(word)*'_ '
    while j&lt;20:
        letter=input('Give a letter: ')
        for i in range(len(word)):
            if word[i]==letter and new_word[i]=='_':
                new_word=new_word.replace(new_word[i],letter)
        if new_word.replace(' ','')==word:
            print('You won!')
            break    
        j+=1
        print(new_word)

hangman()
</code></pre>
