Complete the code to define the Restaurant class with a name attribute.
class Restaurant: def __init__(self, [1]): self.name = name
The constructor needs a parameter name to set the restaurant's name.
Complete the code to add a method that adds a Menu item to the Restaurant.
class Restaurant: def __init__(self, name): self.name = name self.menu_items = [] def [1](self, item): self.menu_items.append(item)
The method to add a menu item should be named add_menu_item to clearly describe its purpose.
Fix the error in the Order class constructor to correctly initialize the order_id attribute.
class Order: def __init__(self, [1]): self.order_id = order_id self.items = []
The constructor must accept order_id as a parameter to initialize the attribute.
Fill both blanks to create a method in Order that adds a Menu item to the items list.
class Order: def __init__(self, order_id): self.order_id = order_id self.items = [] def [1](self, [2]): self.items.append(item)
The method should be named add_item and take a parameter item to add to the order.
Fill all three blanks to create a method in Menu that returns a dictionary of item names and prices for items priced above a threshold.
class Menu: def __init__(self): self.items = {} def get_expensive_items(self, price_threshold): return {name: [1] for name, [2] in self.items.items() if [3] > price_threshold}
The dictionary comprehension uses price as the value, iterates over price pairs, and compares price to the threshold.