Created
November 26, 2013 07:22
-
-
Save meoooh/7654561 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RightDoor(object): | |
def right_open(self): | |
print "RightDoor open complete" | |
self.beep() | |
class LeftDoor(object): | |
def left_open(self): | |
print "LeftDoor open complete" | |
self.beep() | |
class Speaker(object): | |
def beep(self): | |
print 'Beep!' | |
class Car(LeftDoor, RightDoor, Speaker): | |
def door_open(self): | |
self.right_open() | |
self.left_open() | |
c = Car() | |
c.door_open() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment