TypeError: object() takes no parameters
# Enter a code
class Animal(object):
def _init_(self,name,age):
self.name=name
self.age=age
# pass
dog=Animal('d',1)
cat=Animal("c",2)
print(dog.name)
print(dog.age)
运行失败
Traceback (most recent call last): File "index.py", line 7, in dog=Animal('d',1) TypeError: object() takes no parameters