Created
November 26, 2013 07:19
-
-
Save meoooh/7654544 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 Car(LeftDoor, RightDoor): | |
def door_open(self): | |
self.right_open() | |
self.left_open() | |
def beep(self): | |
print 'Beep!' | |
c = Car() | |
c.door_open() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment