What I wonder is this. In Francise class and available_menu method, the line "if time >= menu.start_time and time <= menu.end_time: " is written.
Here “menu.start_time” is used and “menu” seems to be an object of “Menu class”. I wonder how that could be?
class Francise: def __init__(self, address, menus): self.address = address self.menus = menus def __repr__(self): return self.address def available.menu(self, time): available_menus =  for menu in self.menus: if time >= menu.start_time and time <= menu.end_time: available_menus.append(menu return available_menus class Menu: def __init__(self, name, items, start_time, end_time): self.name = name self.items = items self.start_time = start_time self.end_time = end_time def __repr__(self): if self == brunch: return "brunch menu available from 11am to 4pm" if self == early_bird: return "early_bird dinner menu available from 3pm to 6pm" if self == dinner: return "dinner menu available from 5pm to 11pm" if self == kids: return "kids menu available from 11am to 9pm " def calculate_bill(self, purchased_items): total_price = 0 for element in purchased_items: total_price += self.items[element] return total_price
When you ask a question, don’t forget to include a link to the exercise or project you’re dealing with!
If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. That way you’ll be helping everyone – helping people to answer your question and helping others who are stuck to find the question and answer!