Question: PYTHON Complete top_students function The function takes studs as an argument then checks who has the top grade and returns it as a {str} as

PYTHON

Complete top_students function

The function takes studs as an argument then checks who has the top grade and returns it as a {str} as shown in the last line of each check

PYTHON Complete top_students function The function takes studs as an argument then

1 from collections import defaultdict 2 SCALE {'A+ ' : 4.0, 'A': 4.0, 'A-': 3.7, 3 4. F:0. 7 8 def top_students (stu_grades (str,str) str: 10 pass 12 if name-' main 13 def check_ans (ans, right_ans): 14 15 16 17 18 19 20 21 22 studs {("Angel. ' , 'C'),("John",'B-'),(Konny. " , "B-'),('Leon ' , "D'),("Porsche", "C+")} 23 24 25 26 check_ans (ans, 'John', 'Konnv) 27 28 29 studs {('Angel. ' , 'C'),("John', 'D'),(Konny. ' , 'C'),('Leon ' , 'F'),('Porsche', 'C')} 30 if (ans -right_ans): print('RIGHT Answer!') else: print( 'WRONG Answer!) print('input answer was-, ans) print(right answer is -right_ans) #Check 1 print('argumentstuds) ans = top students(studs) print( answer ans) # Check 2 print('argumentstuds) ans = top students(studs) print(answerans) 32 33 check_ans(ans, 'Angela', Konay''Porsche')

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!