大家看看这段代码有什么毛病吗?
# Enter a code
class Anamial():
def_init_(self, name, age):
pass
dog=Anamial('dog',3)
cat=Anamial('cat',4)
print(dog.name)
print(dog.age)
错误提示 File "index.py", line 3 def_init_(self, name, age): ^ SyntaxError: invalid syntax
# Enter a code
class Anamial():
def_init_(self, name, age):
pass
dog=Anamial('dog',3)
cat=Anamial('cat',4)
print(dog.name)
print(dog.age)
错误提示 File "index.py", line 3 def_init_(self, name, age): ^ SyntaxError: invalid syntax
2020-09-08
举报