Created
February 27, 2014 18:57
-
-
Save zeldani/9256652 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 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