All you need to do is get rid of the first hangman()
call:
...
for i in range(1, num_of_players + 1):
print(players_dict['Player {}'.format(i)]
if hangman() is False:
results += False
else:
results += True
If you need to keep hold of the value returned, assign it to a variable beforehand:
...
r = hangman()
if r is False:
results += False
else:
results += True
Furthermore, you can shorten this code simply by writing the following (assuming you don’t keep the result):
results += hangman()
1
solved Implementation of simple game with many rounds and players [closed]