python中的特定子类给出了语法错误

时间:2016-02-18 23:30:09

标签: python pygame

class Item():
    def __init__(self, name, cost, image):
        self.name = name
        self.cost = cost
        self.image = image

class Weapon(Item):
    def __init__(self, name, cost, image, damage):
        self.damage = damage
        super().__init__(name, cost, image)

class W_S(Weapon):
    def __init__(self):
        super().__init__(name="Wooden Sword", cost = 50, damage = 3, image = pygame.image.load('wood_sword.png')

class S_S(Weapon): #Syntax error here
    def __init__(self):
        super().__init__(name="Stone Sword", cost = 75, damage = 6, image = pygame.image.load('stone_sword.png')

class I_S(Weapon):
    def __init__(self):
        super().__init__(name="Iron Sword", cost = 100, damage = 9, image = pygame.image.load('iron_sword.png')

我正在尝试为S_S(石剑)创建一个基本的武器子类,我收到一个错误,突出显示class中的单词class S_S(Weapon):

1 个答案:

答案 0 :(得分:1)

您在调用guest的所有行的末尾都缺少结束语。