Question 3: List

Ben wants to track his homework scores for the week. He needs to calculate the total score, the average score, and the difference between his highest and lowest scores. Write a Python program to help Ben with his calculations.

  • Start by asking for Ben’s name and store it in a variable called name.
  • Define a list to store Ben’s scores. You can start with an empty list called scores.
  • Ask Ben to input his score for each homework assignment and add it to the list. Repeat this for 5 assignments.
  • Calculate the total score by summing all the scores in the list.
  • Calculate the average score by dividing the total score by the number of assignments in the list.
  • Find the highest score in the list and the lowest score in the list.
  • Calculate the difference between the highest and lowest scores.
  • Print a message that includes Ben’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!