我的所有课程都没有定义场景错误。我错过了什么吗?
class Survived(scene):
quips1 = [
'Your good at this game',
'Way to go!',
'I didnt think you would make it'
'Thank for playing this game!'
]
def enter(self):
print Survived.quips [randint(0, len(self.quips1) -1)]
exit(1)
class Scene(object):
def enter(self):
print "This scene is not yet configured. Subclass it and implement enter()."
答案 0 :(得分:1)
Python区分大小写,您应拼写Survived(Scene)
。此外,Scene
类应在 Survived
之前声明为,否则您将获得未定义的异常。
这样的事情:
class Scene(object):
def enter(self):
print "This scene is not yet configured. Subclass it and implement enter()."
class Survived(Scene):
quips1 = [
'Your good at this game',
'Way to go!',
'I didnt think you would make it'
'Thank for playing this game!'
]
def enter(self):
print Survived.quips [randint(0, len(self.quips1) -1)]
exit(1)