Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Unicity is a must! ;) solution in Creative category for Every Person is Unique by Stensen
from dataclasses import dataclass
from datetime import date
from re import findall
@dataclass
class Person:
first_name: str
last_name: str
birth_date: str
job: str
working_years: int
salary: int
country: str
city: str
gender: str = 'unknown'
title= lambda self: ['He is', 'She is'][self.gender.startswith('f')] if not self.gender.endswith('n') else 'Is'
name = lambda self: f'{self.first_name} {self.last_name}'
age = lambda self: (date(2018, 1, 1) - date(*list(map(int, self.birth_date.split('.')))[::-1])).days // 365
work = lambda self: f'{self.title()} a {self.job}'
money= lambda self: ' '.join([i[::-1] for i in findall('.{1,3}', str(12*self.salary*self.working_years)[::-1])][::-1])
home = lambda self: f'Lives in {self.city}, {self.country}'
Oct. 10, 2020