Shopping list

Report a typo

Ruth goes shopping today, so she wrote down things that she would like to buy at the grocery store. All of these things are in the given shopping_list variable, it has already been created. The initial contents of shopping_list are not visible, but you can assume it contains "milk" among other items.

Your task is to modify this list based on Ruth's changes:

  1. Ruth decides not to buy milk, so you need to remove "milk" from the list.

  2. Ruth then adds "brownie" to her list as the last item.

Notes:

  • You should modify the existing shopping_list variable, not create a new list.

  • Do not print the results or the modified list.

Your code should perform these operations on the shopping_list without any output or return value.

You can add an item with list.append() and delete it with list.remove().

Write a program in Python 3
# remove a product and add another one; do not create a variable, it has already been created
___

Create a free account to access the full topic