0%
简介
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
class Tool(): def work(self): return 'tool work' def car(self): return 'car will run'
class Food(): def work(self): return 'food work' def cake(self): return 'i like cake'
class Person(Tool,Food): pass
p = Person() p_car = p.car() p_cake = p.cake() p_work = p.work() print(p_car,p_cake,': ',p_work) print(Person.__mro__)
|