etc.
'EEE',
(e) 'Imagine a dictionary with the structure student_id:[student_major, student_cgpa]. Assume majors are represented by strings like 'CoE',
for
all
students
Now define a function avg_cgpa_by_major that takes such a dictionary and a string for major as inputs and returns the average cgpa
with that major.
Sample input/Output:
In_1 = {41251:['CoE',2.5],42509:['EEE',3.1],4 41713:['CoE',1.9],41101:['CoE',2.7]}
print(avg_cgpa_by_major(In_1,"CoE"))
Not the question you are looking for? Ask here!
Enter question by text
Enter question by image
Upgrade to Asksia Pro
Join a AskSia's Pro Plan, and get 24/7 AI tutoring for your reviews, assignments, quizzes and exam preps.