[Solved] NameError: name ‘num’ is not defined

num is not actually used in multiply() so there is no reason to pass it in. Instead, declare multiply() without the argument: def multiply(): ”'(num1 * num2)”’ . . And call it from __main__ like this: if maths == “Multiplication” or “m” or “x”: multiply() There seems no point in checking within multiply() whether it … Read more

[Solved] NameError: variable is not defined [closed]

Is this what you want? def existingPlayers(name, players): ”’ Check if player name already exists ”’ for player in players: if player[0].lower() == name.lower(): return True return False def getPlayerNames(players): ”’ Get the names of the players. Check if the number of players and player names are valid ”’ while True: name = input(“Enter player … Read more