HW5Q1.2

 avatar
user_7676782
python
2 years ago
429 B
1
Indexable
Never
class Diet:
    def __init__(self, year_of_birth, gender):
        self.__year_of_birth = year_of_birth
        self.__gender = gender
        self.__calories = 1000

    def eat_more(self):
        self.__calories += 100

    def get_eat(self):
        return self.__calories

    def eat_less(self):
        self.__calories -= 100

    def __str__(self):
        return "The calories is: "+ str(self.__calories)