write a python ,Assume you have been given a list of lists where the student names and  their grades of the A-level courses are given. The minimum GPA needs to be  calculated for the BEST 2 grades obtained by the student. So, the student  must have at least 2 subjects in his/her A levels. According to the scale  (A=5, B=4, C=3 & D=2). Subjects with E grades will not be considered. See  the sample inputs and outputs below with an explanation to understand  better.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

write a python ,Assume you have been given a list of lists where the student names and 
their grades of the A-level courses are given. The minimum GPA needs to be 
calculated for the BEST 2 grades obtained by the student. So, the student 
must have at least 2 subjects in his/her A levels. According to the scale 
(A=5, B=4, C=3 & D=2). Subjects with E grades will not be considered. See 
the sample inputs and outputs below with an explanation to understand 
better.
================================================

Given list of list1:
given_data = [["Alice", ["A","C","C","A"]], ["Sam", [ "A", "C", "B"]], 
["Amy", ["A","E"]],["Robin", ["A"] ] ]

Sample Output 1:
Based on the A level result Alice's minimum GPA is 5.0
Based on the A level result Sam's minimum GPA is 4.5
Sorry Amy the grades allowed in your top 2 grades are only A/B/C/D
Robin: You must have at least 2 subjects in A level.

Explanation1:
Alice's GPA is based on her top 2 grades, A=5 and A=5. Her GPA calculation 
is GPA = 5+5/2 = 5.0
Sam's GPA is based on his top 2 grades, A=5 and B=4. His GPA calculation is 
GPA = 5+4/2 = 4.5
Amy's top 2 grades consist of an E grade. So her GPA is not calculated.
Robin had only 1 A-level subject so his GPA is also not calculated.
Finally, print the dictionary.
================================================

Given list of list2:
given_data = [["Alice", ["A"]], ["Sam", [ "A", "E", "B"]]]

Sample Output 2:
Alice: You must have at least 2 subjects in A level.
Based on the A level result Sam's minimum GPA is 4.5
{'Sam': 4.5}

Explanation2:
Alice had only 1 A-level subject so his GPA is also not calculated.
Sam's GPA is based on his top 2 grades, A=5 and B=4. His GPA calculation is 
GPA = 5+4/2 = 4.5
Finally, print the dictionary.

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY