About syntax errors in python3.7!

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?

Mar.24,2021

  

you use @ staticmethod to turn the _ _ init__ method into a static method.
simply means that a static method is a function defined inside a class, independent of the class.
and the _ _ init__ method is executed when the class is instantiated, so your "Xiaoming" is passed to self, and your player_name is not assigned.

Menu