<filename>3. Python Advanced (September 2021)/3.2 Python OOP (October 2021)/24. Exam Preparation/22.08.2020/project/rooms/room.py
class Room:
    def __init__(self, name, budget, members_count):
        self.family_name = name
        self.budget = budget
        self.members_count = members_count
        self.children = []
        self.expenses = 0

    @property
    def expenses(self):
        return self.__expenses

    @expenses.setter
    def expenses(self, value):
        if value < 0:
            raise ValueError("Expenses cannot be negative")
        self.__expenses = value

    def calculate_expenses(self, *args):
        self.expenses = sum(el.get_monthly_expense() for arg in args for el in arg)
