Question: The goal of this lab is to create a function that calculates the alphabetical grades for a student. Conditions for alphabetical grades are given below.
The goal of this lab is to create a function that calculates the alphabetical grades for a student. Conditions for alphabetical grades are given below. To be specilic, you will receive a list of numeric scores in your function parameter and you need to return a list of grades. For example, if you receive [79,80,92,96], you will return ['F, B B+,A,A+;,B+7. Here, the last grade in the list (B+) represents the average grade for the student which is calculated in the following way: Average grade =no.ofseorescotatscore=479400+92+96=86.75 Since the average grade 86.75 belongs in the range 80 to 90 (see above table), the average alphabetical grade is 'B+'. Note: If the size of the input list (function argument) is n, the size of the returned list will be n+1. Function Sigaature: def calculate grades (scores): \#your code goes here neturn grades 1. Use the calculate grades function signature above. 2. Define a list for storing alphabetical grades. 3. Define a variable for calculating total score. 4. Iterate over the scores list using a for or while loop. 5. Find the alphabetical grades using if-elif-else and add them in the grades list that you defined in step 2. Also, add the scores to the total in each iteration. 6. Finally, calculate average and find its corresponding grade using if-elif-else. Then, add it to the grades list 7. Return the grades list
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
