Question: Write a Python program that allows a user to update the stock of an item, add a new item, and delete an existing item. Include
Write a Python program that allows a user to update the stock of an item, add a new item, and delete an existing item. Include a brief explanation of your solution.
You're given a dictionary that stores the stock of items in a store:
stock = {'apple': 50, 'banana': 20, 'orange': 35}
Step by Step Solution
There are 3 Steps involved in it
Python stock apple 50 banana 20 orange 35 def updatestockitem quantity if item in stock stockitem quantity printfThe stock of item has been updated to stockitem else printfThe item item does not exist ... View full answer
Get step-by-step solutions from verified subject matter experts
