Last active
October 2, 2017 01:48
-
-
Save SpikeXy/dfd75fd04a308541e9493bfdfb6014be to your computer and use it in GitHub Desktop.
@Property #python
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 Student(object): | |
@property | |
def birth(self): | |
return self._birth | |
@birth.setter | |
def birth(self, value): | |
self._birth = value | |
@property | |
def age(self): | |
return 2015 - self._birth |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment