我在 python shell 3.3.2 中运行该代码,但它给了我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.age
hippo=Animal('2312','321312')
hippo.description()
我是python的新手,我不知道如何修复这些代码。谁能给我一些建议?提前致谢。