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.
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.Ask the group about specific snacks:
Press 1
) or skip it (Press 2
).snack_list
and its price to snack_cost
if they choose to include it.Check conditions after each snack is chosen:
"Warning: Your total cost has exceeded your budget of 50 dollars!"
After all choices are made, print a summary:
We’re always looking for international STEM educators to join our team. If you are interested, please send us a mail and we’ll get back to you!
If you have any questions, kindly send us a mail. Don’t forget to follow and like all our social accounts to get updates on competitions!