다중상속

· AboutPython
[다중상속] 여러개의 클래스를 상속 받을 수도 있습니다. class Car01 : def drive(self): print('drive() method called!!') class Car02 : def turbo(self): print('turbo boost up!') class Car03 : def fly(self): print('fly to the moon!') class Car(Car01,Car02,Car03): def __init__(self): pass mycar = Car() mycar.drive() mycar.turbo() mycar.fly() ''' drive() method called!! turbo boost up! fly to the moon! ''' mycar은 운전도 되고, 부스..
scone
'다중상속' 태그의 글 목록