Question: a. In python write a function takes inventory as a parameter the function should place an item into an inventory by name, price and quantity

 a. In python write a function takes inventory as a parameter

a. In python write a function takes inventory as a parameter the function should place an item into an inventory by name, price and quantity of the item >>> inventory - {} >>>add_item(inventory) Enter the name of the item: poncho Enter the price of this item (format: 21.67): Enter the price of this item (format: 21.67): red Enter the price of this item (format: 21.67): 5 Enter the price of this item (format: 21.67): 15.67 Enter the number of items: 5,4 Enter the number of items (must be an integer): Enter the number of items (must be an integer): red Enter the number of items (must be an integer): 20 20 Poncho(s) have been added to inventory >>> print(inventory) {'Poncho': {'price': 15.67, 'count': 20}} b) In python write a function takes the dictionary inventory as a parameter, the function should remove an item placed in the inventory during the previous function >>> inventory = {"Poncho": {"price": 15.67, "count": 15}, "Jacket": {"price": 49.99, "count": 25}, "Belt": {"price":9.95, "count":20}} >>> remove_item(inventory) Enter the name of the item: duck There are no Duck(s) in inventory remove_item(inventory) Enter the name of the item: belt Enter the number of items: 2.5 Enter the number of items (must be an integer): red Enter the number of items (must be an integer): 5 5 Belt(s) have been removed from inventory >>> print(inventory["Belt"] {'price': 9.95, 'count': 15} c) In python write a function that calculates the cost of the inventory items calc_worth(inventory) There are 20 Belt(s) worth $199.00 There are 25 Jacket(s) worth $1,249.75 There are 15 Poncho(s) worth $235.05 The total value of the inventory is $1,683.80

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!