Skip to content

Instantly share code, notes, and snippets.

@zeldani
Created February 27, 2014 18:57
Show Gist options
  • Save zeldani/9256652 to your computer and use it in GitHub Desktop.
Save zeldani/9256652 to your computer and use it in GitHub Desktop.
class A:
n = 5
def conta(self, x): return A.n*x
class B(A):
def conta(self, x): return A.conta(self, x)**2
def outraconta(self, x): return self.conta(x)+1
a = A()
b = B()
print a.conta(4)
print b.conta(3)
print b.outraconta(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment