Question 8: List

Max is saving money for a special project and wants to track his monthly savings progress. He wants to calculate the total amount saved, the average savings per week, and the difference between the highest and lowest weekly savings. Write a Python program to help Max with his calculations.

  • Start by asking for Max’s name and store it in a variable called name.
  • Define a list to store Max’s savings for each week. You can start with an empty list called weekly_savings.
  • Ask Max to input his savings for each week and add it to the list. Repeat this for 4 weeks.
  • Calculate the total amount saved by summing all the savings in the list.
  • Calculate the average savings per week by dividing the total savings by the number of weeks in the list.
  • Find the maximum and minimum savings in the list.
  • Calculate the difference between the maximum and minimum savings.
  • Print a message that includes Max’s name and the results of the calculations in a friendly sentence.
Write what you are looking for, and press enter to begin your search!