• 2022-06-06 问题

    ‎请执行以下代码,说明错误出现的行数。​1. class Dog(object):​2. def __init__(self,name):​3. self.name = name​4. @property​5. def eat(self):​6. print(" %s is eating" %self.name)​7. ​8. d = Dog("wangwang")​9. d.eat()​‎知识点:属性的定义和使用​

    ‎请执行以下代码,说明错误出现的行数。​1. class Dog(object):​2. def __init__(self,name):​3. self.name = name​4. @property​5. def eat(self):​6. print(" %s is eating" %self.name)​7. ​8. d = Dog("wangwang")​9. d.eat()​‎知识点:属性的定义和使用​

  • 1