Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions