Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
meh solution in Clear category for Every Person is Unique by Leonix
class Person(object):
def __init__(self, first_name, last_name, birth_date, job, working_years, salary, country, city, gender='unknown'):
self.__dict__.update(locals())
del self.__dict__['self']
def name(self):
return f'{self.first_name} {self.last_name}';
def age(self):
return 2017 - int(self.birth_date.split('.')[2])
def work(self):
return { 'unknown': 'Is a ',
'male': 'He is a ',
'female': 'She is a ' }[self.gender] + self.job
def money(self):
return f'{self.working_years * 12 * self.salary:,d}'.replace(',', ' ')
def home(self):
return f'Lives in {self.city}, {self.country}'
June 27, 2019