Question: Use Python. Please include revision details in the code and a few comments. Dr. Phloog teaches Python to extraterrestrials at Area 51. Each semester he

 Use Python. Please include revision details in the code and a

Use Python. Please include revision details in the code and a few comments.

Dr. Phloog teaches Python to extraterrestrials at Area 51. Each semester he gives a number of quizzes and he drops 1 out of 3 lowest grades. If he gives 35 quizzes, the lowest grade gets dropped before computing the average. If he gives 6-8 quizzes, the two lowest grades get dropped. He also gives letter-grades based on an X,Y,Z scale where X represents an average score less than 80% (failing) and Z represents an average score greater than 90% (distinction). Any other grade is a Y (passing). Write a function called findGrade (grades) that takes a list of quiz grades (grades) and returns the average and a letter grade based on Dr. Phloog's criteria. Your program must exclude the appropriate number of low grades, properly compute the average and the correct letter grade. I have provided a template for testing your function once you have developed it. USE THE TEMPLATE. SOME HINTS: 1. You should use floor division (//) on the length of the list to determine how many grades to exclude. 2. To exclude the lowest grades, begin by using the list sort () method. Then slice the list above the number of grades you wish to exclude. 3. To compute the average, iterate through the remaining grades and update a sum variable with each item. After having computed the sum, compute the average by dividing by the list length. 4. Simple comparisons are all that is necessary to find the letter grade from the average. 5. Note that in the template, two values are returned in parentheses. The parentheses form a "tuple" it is like a list but is "immutable". Program to calculate grades for Dr. Phloog 80.00Y 75.00X 91.86> Z 79.86X 85.17Y

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!