Question 11: List

Movie Night Snacks

It’s Friday evening, and a group of friends is gathering for a long-awaited movie night. To make the night more enjoyable, they decide to prepare a variety of snacks. However, they have a budget of 50 dollars and need to carefully select which snacks to include without overspending. Can they plan the perfect snack menu while sticking to their budget?

Write a Python program to help the group decide which snacks to include while tracking their total cost.

  1. Start by defining two empty lists:

    • snack_list to store the names of the snacks chosen.
    • snack_cost to store the prices of the snacks chosen.
  2. Ask the group about specific snacks:

    • For each snack, prompt the group with an option to add it to their list (Press 1) or skip it (Press 2).
    • Add the snack name to snack_list and its price to snack_cost if they choose to include it.
  3. Check conditions after each snack is chosen:

    • If the total cost exceeds 50 dollars, print a warning:
      "Warning: Your total cost has exceeded your budget of 50 dollars!"
  4. After all choices are made, print a summary:

    • The total number of snacks chosen.
    • The names of the snacks in the list.
    • The total cost.
Write what you are looking for, and press enter to begin your search!