I have the following code:
# capture the number of players
def people():
users = (input("how many players? "))
while users.isdigit() == False:
users = (input("how many players? "))
users = int(users)
# capture each player's name
def player_name():
for person in range(people):
name = input("player's name? ")
players[name] = []
game_type = input("ongoing competition or single play? ")
players = {}
if game_type == 'single play':
people()
player_name() # <<< error
When the code gets to player_name() at the bottom I get this error.
TypeError: 'function' object cannot be interpreted as an integer
How do I fix this?
peopleinplayer_name()to represent?player_name()peopleused to beusersbut I got an error saying 'users' is not defined. After I input the number of players, I want to name each player.