0
点赞
收藏
分享

微信扫一扫

新手上路,遇到问题,求解:

回望这一段人生 2022-04-21 阅读 50
python
class Game(object):

    top_score = 0

    def __int__(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(" %s 开始游戏" % self.player_name)


Game.show_help()

Game.show_top_score()

game = Game("小明")

game.start_game()

我这个代码是照着视频课程抄上去的,却不能执行。倒数第二行 “小明” 高亮显示。可是原视频博主却能正常执行,求解?????

举报

相关推荐

0 条评论