Question: Need help with this test code: Solution Specifications Your solution to this problem must meet the following criteria. 1. You must define a class FoodLog

Need help with this

Need help with this test code: Solution Specifications Your solution to this

test code:

problem must meet the following criteria. 1. You must define a class

Solution Specifications Your solution to this problem must meet the following criteria. 1. You must define a class FoodLog in the file food_log.py with a dictionary attribute called food_log. 2. The class must include an instance method called add_food which takes two parameters. - a string for the name of food - an integer for the number of calories 3. The instance method add_food will add food to the dictionary with the key being the name and the value being the calories import food_log \# test the class thanksgiving_meal = food_log. FoodLog() thanksgiving meal.add_food ("Mashed Potato", 206) thanksgiving meal.add_food ("Stuffing", 150) print(thanksgiving meal.food_log)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!