Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@edenau
Created April 3, 2020 16:20
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 edenau/8cf6006a3e479e0bc2bd594f7fe3044d to your computer and use it in GitHub Desktop.
Save edenau/8cf6006a3e479e0bc2bd594f7fe3044d to your computer and use it in GitHub Desktop.
class Shape:
pass
class Rectangle(Shape):
def __init__(self, length, width):
self.length = length
self.width = width
self.area = length * width
def get_area(self):
return self.length * self.width
class Square(Rectangle):
def __init__(self,length):
Rectangle.__init__(self,length,length)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment