Created
April 20, 2010 05:18
-
-
Save elben/372078 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 Clown(object): | |
def __init__(self, name): | |
self.name = name | |
def nice_hi(self): | |
return "Helloooo " + self.format_name() | |
def format_name(self): | |
return self.name + " (the clown)" | |
class ScaryClown(Clown): | |
def __init__(self, name): | |
Clown.__init__(self, name) | |
def format_name(self): | |
return self.name + " (the scary clown)" | |
c = ScaryClown("Billy") | |
print c.nice_hi() # Helloooo Billy (the scary clown) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment