Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2019 Wurzburg Germany September 16 20 2019 Proceedings Part 2 Lnai 11907

Authors: Ulf Brefeld ,Elisa Fromont ,Andreas Hotho ,Arno Knobbe ,Marloes Maathuis ,Celine Robardet

1st Edition

3030461467, 978-3030461461

More Books

Students also viewed these Databases questions

Question

3 The distinction between microeconomics and macroeconomics.

Answered: 1 week ago