Write a program that reads a list of scores and then assigns grades based
on the following scheme:
The grade is A if score is best – 10.
The grade is B if score is best – 20.
The grade is C if score is best – 30.
The grade is D if score is best – 40.

python
Expert-verified answer
0 (0 stars)
0
AFOKE88 1 year ago
746 response - 0 helps

The py thon program that reads a list of scores and then assigns grades based on the given scheme is; As written below

How to write a Program in Py-thon?

The program steps when written in Py-thon is;

Enter scores: 40 55 70 58

Student 0 score is 40 and grade is C

Student 1 score is 55 and grade is B

Student 2 score is 70 and grade is A

"""

def get_grade(points):

   score = 70 - points

   grades = [(40, 'D'), (30, 'C'), (20, 'B'), (10, 'A')]

   result = ''

   for grade in grades:

       if score <= grade[0]:

           result = grade[1]

   return result

def scorer(points):

   results = []

   for point in points:

       results.append(get_grade(point))

   return results

if __name__ == "__main__":

   user_input = input('Enter scores: ')

   points = [int(n) for n in user_input.split(' ')]

   points = [ int(n) for n in user_input.split(' ')]

    scores = scorer(points)

   for n in range(len(points)):

       m sg = 'Student {} score is {} and grade is {}'.format(

           n, points[n], scores[n]

       )

       print(m sg)

Read more about Py-thon Program at; https://brainacademy.pro/question/26497128

#SPJ1

Still have questions?