打印啥?
class Animal(object): hobby = "eat" def run(self): print(self.hobby) return self.hobby class Dog(Animal): hobby = "sleep" dog = Dog() print(dog.hobby) print(dog.run())答案
sleep sleep sleep
考点:
面向对象
继承
内置变量
返回值
原文地址:https://www.cnblogs.com/shijieli/p/10160916.html
时间: 2024-10-11 09:56:39