Part 3 Add a function that will allow a user to remove an item from the grocery
ID: 3626638 • Letter: P
Question
Part 3Add a function that will allow a user to remove an item from the grocery list.
1. The function should be executed each time the user presses the "r" key on the keyboard.
2. The script should prompt the user for the name of a grocery item,
3. If the item is on the list then prompt the user to confirm the deletion of the item (using the name of
the item),and then delete the item from the lis. If the item is not not the list then the program should
show a message to the user.
4. i.e., if user indicates that they want to delete "bread" then the program should ask the user if they
wish to delete "bread" from the list. If the user confirms that, then the program should remove "bread" from the list.
A sample session: user wants to remove a bread item from the grocery list
My Grocery List
a: Add an item to the grocery list
r: Remove an item from the grocery list
l: List the items in the grocery list
Please enter an option: r
What item would you like to remove to the grocery list: bread
Please confirm that you wish to remove bread from the grocery list: y
bread has been removed from the grocery list.