Question: Create a python class Food: Food Attributes: name: str representing the name of the dish price: float representing the price of the dish; round to
Food Attributes: name: str representing the name of the dish price: float representing the price of the dish; round to 2 decimal places; price will be greater than or equal to 0.00 e e ingredients: list of strings representing the ingredients of the dish .food_type: a string representing the type of food. Each food will either be an appetizer", "entree", or "dessert calories: an int representing the amount of calories in the dish Methods: init0 Initializes the following attributes from parameters: o name: str o price: float: round to 2 decimal places o ingredients: list o food type: str o calories: int Arguments for all the parameters will be passed to the_init_ method when a new Food object is created eq_ (Food object, Food object) . Takes in two Food objects . Returns True if two Food objects have all the same attributes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
