Implementation of simple game with many rounds and players : <p>I have to make a game where n people play hangman and the game keeps their results and if they win the round, then they go on until there is only one player left(that player wins) or none left(nobody wins). My hangman code is ready, so I do not need anything concerning the hangman function. However, I need some help to make a function that does the following:</p>

<p>1)Asks how many players will play</p>

<p>2)Asks their names and stores them</p>

<p>3)Plays the first round and if hangman()==True (meaning the player won) for a player, then this player goes on to the next round, otherwise not</p>

<p>4)If somebody wins, then we have a winner and the game ends</p>

<p>I have already made the part that the game asks the number of player, asks their names and makes them play. My hangman() function returns either True or False. However, it seems that I have a problem. Every time a player plays the game, the hangman() function runs twice. I don't know why this happens. I would like some help fixing that and also to write the part where each round is played. </p>

<pre><code>def game():
    players_dict={}
    results=[]
    num_of_players=int(input('How many players will play? '))
    for i in range(1,num_of_players+1):
        a=input('Give the name of Player {}: '.format(i))
        players_dict['Player {}'.format(i)]=a
    for i in range(1,num_of_players+1):
        print(players_dict['Player {}'.format(i)])
        hangman()
        if hangman()==False:
            results+=False
        else:
            results+=True
</code></pre>
