Question 10: 2 Lists

  • Start by defining two empty lists:

    • shopping_list to store the names of the items bought.
    • shopping_cost to store the prices of the items bought.
  • Ask the customer if they want to buy specific items:

    • For each item, prompt the customer with an option to buy it (Press 1) or skip it (Press 2).
    • Add the item name to shopping_list and its price to shopping_cost if the customer chooses to buy it.
  • Check conditions after each purchase:

    • If the total cost exceeds 2000 dollars, print a warning:
      "Your total has exceeded your budget of 2000 dollars!"
    • If the same item is added to the list more than once, print a message indicating that the item has already been added.
  • After shopping, print a summary:

    • The total number of items purchased.
    • The names of the items in the shopping list.
    • The total bill.
Write what you are looking for, and press enter to begin your search!