Challenge: Create a Dictionary and Replace Key-value Pairs

Write code to create a dictionary that contains students' names and scores and then replace the scores with the total and average scores.

Create a dictionary that contains students’ names and scores obtained in three subjects. Write a program to replace the scores in the three subjects with the total and average scores. Also, report the top student in the class:

  • Input: A dictionary that contains students’ names, and scores obtained in three subjects.
  • Output: A dictionary that contains students’ names and the total and average score in the three subjects. The name and score of the top student in the class will also be printed.

Get hands-on with 1200+ tech skills courses.