我在python shell 3.3.2中運(yùn)行了該代碼,但是它給了我SyntaxError: invalid syntax。class Animal(object): """Makes cute animals.""" is_alive = True def __init__(self, name, age): self.name = name self.age = age def description(self): print self.name #error occurs in that line! print self.agehippo=Animal('2312','321312')hippo.description()我是python的新手,我不知道該如何修復(fù)該代碼。誰能給我一些建議?提前致謝。
添加回答
舉報(bào)
0/150
提交
取消