Answered step by step
Verified Expert Solution
Question
1 Approved Answer
( e ) 'Imagine a dictionary with the structure student _ id: [ student _ major, student _ cgpa ] . Assume majors are represented
e 'Imagine a dictionary with the structure studentid:studentmajor, studentcgpa Assume majors are represented by strings like 'CoE', 'EEE', etc. Now define a function avgcgpabymajor that takes such a dictionary and a string for major as inputs and returns the average cgpa for all students with that major.
Sample inputOutput:
In:CoE:EEE:CoE:CoE
printavgcgpabymajorIn"CoE"
f Define a function called searchdict which will take a dictionary and a number as arguments. It will search through dictionary's values, and return True if that number appears in the dictionary as an integer or as a string
Sample inputOutput:
d 'Ahmet': 'Zeynep': Mehmet:
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