Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write the Python code to implement the function scores(d), where d is a dictionary representing student scores. The keys in d are strings representing student
Write the Python code to implement the function scores(d), where d is a dictionary representing student scores. The keys in d are strings representing student names, and the values are dictionaries. Each of these inner dictionaries has categories (like 'Math', 'Science', 'English') as keys, and scores (as integers) in those subjects as values. The function returns a new dictionary with each category as keys and the average score of all students in that category as values. scores_dict = { 'Alice': {'Math': 90, 'Science': 85, 'English': 95}, 'Bob': {'Math': 80, 'Science': 90, 'English': 85}, 'Charlie': {'Math': 85, 'Science': 95, 'English': 80} } >>>scores(scores_dict) { 'Math': 85.00, # Average of Math scores 'Science': 90.00, # Average of Science scores 'English': 86.67 # Average of English scores
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started