Question 4: List

Zoe is running a lemonade stand and wants to keep track of her earnings and expenses to calculate her profit. Each day, she records how much she earned and how much she spent on supplies. At the end of the week, she wants to know if she made a profit. Write a Python program to help Zoe with her calculations.

  • Start by asking for Zoe’s name and store it in a variable called name.
  • Create a list called earnings to store the earnings from each day.
  • Create a list called expenses to store the expenses for each day.
  • Ask Zoe to input her earnings and expenses for each of the 5 days.
  • Append each day’s earnings and expenses to their respective lists.
  • Calculate the total earnings by summing the values in the earnings list.
  • Calculate the total expenses by summing the values in the expenses list.
  • Calculate the profit by subtracting the total expenses from the total earnings.
  • Print a message that includes Zoe’s name and the profit in a friendly sentence.
Write what you are looking for, and press enter to begin your search!