start.
class Engine:
def __init__(self):
self.power = 100
def start(self):
return "engine"
class Radio:
def __init__(self):
self.volume = 5
def start(self):
return "radio"
class Car(Engine, Radio):
pass
c = Car()
print(c.start(), hasattr(c, "power"), hasattr(c, "volume"))
What does the program print?Log in to join the discussion.
Loading…