I display such an error after executing according to the following code.
class Game (object):
top_score = 0
@staticmethod
def __init__(self, player_name):
self.player_name = player_name
@staticmethod
def show_help():
print(":")
@classmethod
def show_top_score(cls):
print(" %d" % cls.top_score)
def start_game(self):
print("..." % self.player_name)
Game.show_help ()
Game.show_top_score ()
game = Game ("Xiaoming")
game.start_game ()
error display:
D:PY001venvScriptspython.exe D:/PY001/cards_main.py
help: let zombies enter the gate
Traceback (most recent call last):
History 0
File "D:/PY001/cards_main.py", line 25, in < module >
game = Game("xiaoming")
TypeError: _ _ init__ () missing 1 required positional argument: "player_name"
Process finished with exit code 1
could you tell me how to modify it in order to solve such a problem?