Before chatGPT

mail@pastecode.io avatar
unknown
python
a year ago
502 B
7
Indexable
Never
from datetime import datetime


class User:
    """
    The class represents a user.
    """
    def __init__(self, first_name, last_name, birth_year):
        self.first_name = first_name
        self.last_name = last_name
        self.birth_year = birth_year

    def get_full_name(self):
        return f"{self.first_name} {self.last_name}"

    def get_age(self):
        return datetime.now().year - self.birth_year

    def how_much_will_be_age(self, year):
        return year - self.birth_year