Question: Python programming Part II: Weighted GPA Calculator (20 points) Write a function gpa calculator) that takes two arguments, in this order I. grades: A list

Python programming
Part II: Weighted GPA Calculator (20 points) Write a function gpa calculator) that takes two arguments, in this order I. grades: A list of strings that represent the letter grades. For simplicity, you only need to think about the letter grades A, B, C, D and E. There will be no grades like B+ or c-, and the grade s can be either uppercase or lowercase, 2. credits.worth: A list of integers which represent the corresponding credits of the courses with the letter grades given in the grades list Let's look at an example about how the arguments work together. Suppose grades'AB E' and ereditsworth 14, 3, 11. This me ans for the first course the student took and got an 'A' in, that course counts for 4 credits; for the second course, for which the student got a B', the class counts for 3 credits; lasty, for the third class, for which the student got a ', that class counts for 1 credit CSE 101- Fall 2017 Lab #3 Page 2 Your function should calculate and return the weighted grade point average after converting each grade to a "grade point" in the range 0.0 through 4.0. If the list of grades contains a grade not listed in the table below, or the list of grades is empty, simply return None. Note that the general formula when calculating the GPA is shown below: total nunber of grade points earned rotal nmber of credits attempted You can also check out htp/facademicanswers walde nu.edu/fay73219 for an example on how to calculate the GPA Grade Grade Points 3.0 2.0 Note: You don't need to worry about invalid course credits, like 0 credits for a course. You may also assume that grades and credits.worth have the same length. Also, the retuned value will always be a floating-point number Examples: Function Call a.calculator ( ,A', 'A, , ,A, r 'A' I , 14, 3, 2, 3] gpa-calculator", E,, ,F,, ,F, r rf'l, [2, 4, 3, 51) gpa caleulator(l'FABA A'. 2, 5,5, 3, 1 Return Value 4.0 0.0 3.1875 Remember: CodeLoad has additional tests for you to try! Upload your code there and see how your code matches up against harder tests
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
