Skip to content

Instantly share code, notes, and snippets.

@elben
Created April 20, 2010 05:18
Show Gist options
  • Save elben/372078 to your computer and use it in GitHub Desktop.
Save elben/372078 to your computer and use it in GitHub Desktop.
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