Created
May 30, 2020 08:59
-
-
Save eclecticmiraclecat/7a69209df857d1cce63216ec4f4c4ba4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Num: | |
... def __init__(self, value): | |
... self.value = value | |
... def __add__(self, other): | |
... return self.value + other.value | |
... | |
>>> num1 = Num(1) | |
>>> num2 = Num(2) | |
>>> num1 + num2 | |
3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment