Exemple #1
0
 def __init__(self, family_name, pension):
     Room.__init__(self,
                   family_name,
                   budget=pension,
                   children=None,
                   expenses=None,
                   members_count=1)
     self.room_cost = 10
 def __init__(self, family_name, salary_one, salary_two, *children):
     Room.__init__(self, family_name, budget=None, members_count=2, children=children, expenses=None)
     self.appliances = [TV(), Fridge(), Laptop()]
     self.budget = salary_one + salary_two
     self.room_cost = 30
     self.members_count += len(children)
     self.child_cost = sum([c.cost for c in children])
     self.expenses = sum([a.get_monthly_expense() * self.members_count for a in self.appliances]) + self.child_cost
Exemple #3
0
 def __init__(self, family_name, salary):
     Room.__init__(self,
                   family_name,
                   budget=salary,
                   members_count=1,
                   children=None,
                   expenses=None)
     self.room_cost = 10
     self.appliances = [TV()]
     self.expenses = sum([
         a.get_monthly_expense() * self.members_count
         for a in self.appliances
     ])
 def __init__(self, family_name: str, pension_one, pension_two):
     Room.__init__(self,
                   family_name,
                   budget=None,
                   members_count=2,
                   children=None,
                   expenses=None)
     self.room_cost = 15
     self.budget = pension_one + pension_two
     self.appliances = [TV(), Fridge(), Stove()]
     self.expenses = sum([
         a.get_monthly_expense() * self.members_count
         for a in self.appliances
     ])
 def __init__(self, family_name, salary_one, salary_two):
     Room.__init__(self, family_name, budget=None, members_count=2, children=None, expenses=None)
     self.room_cost = 20
     self.budget = salary_one + salary_two
     self.appliances = [TV(), Fridge(), Laptop()]
     self.expenses = sum([a.get_monthly_expense() * self.members_count for a in self.appliances])