Created
July 21, 2019 21:49
-
-
Save rch/e08c8c071a02774de7eeafd2b3818dde to your computer and use it in GitHub Desktop.
references
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: | |
def __init__(self, n): | |
self.v = n | |
def add(self, n): | |
self.v += n | |
x = A(3) | |
y = x | |
print(y.v) | |
y.add(2) | |
print(x.v) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment