from datetime import datetime class Person object def __init__ self bo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
from datetime import datetime
class Person(object):
def __init__(self, born):
self.born = born
@property
def age(self):
return self.__age
def _get_born(self):
return self.__born
def _set_born(self, born):
self.__born = born
self.__age = (datetime.now().year - born.year)
born = property(_get_born, _set_born)