Skip to content

Instantly share code, notes, and snippets.

@kenKanata56
Created July 19, 2015 00:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenKanata56/98f6adfc84b067837803 to your computer and use it in GitHub Desktop.
Save kenKanata56/98f6adfc84b067837803 to your computer and use it in GitHub Desktop.
class Television:
def __init__(self,size,weight):
self.size = size
self.weight = weight
def data(self):
print str(self.size)+"kg"
def name(self):
print "tv"
#Inheritance
class ColorTevevision(Television):
#override
def name(self):
print "color tv"
base = Television(12,30)
base.name()
base.data()
a = ColorTevevision(24,35)
a.name()
a.data()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment