Question: I m confused about this question 2) [25 marks] Write a function called remove item that takes the inventory dictionary as its parameter. This function
2) [25 marks] Write a function called remove item that takes the inventory dictionary as its parameter. This function will ask the user to enter the name of the item. If the item is not in the inventory, a message will be displayed and the function will end returning None. If the item is in the inventory, the user will be asked how many of the item to remove and then remove this many of the item from the inventory. Error checking must be implemented to ensure that "count" is an int. For example: 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 How many Belt(s) would you like to remove?: 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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
