Computer Science, asked by CloudDust, 1 day ago

Write a grade program in python using a function called "computegrade" that takes a score as its parameter and returns a grade as a string.
Score Grade
>0.9 = A
>0.8 = B
>0.7 = C
>0.6 = D
<= 0.6 = F

Answers

Answered by BenitaJennifer
0

Answer:

def computegrade(s):

   x = "E"

   if 1.0 > s > 0.9:

       x = "A"

   elif s > 0.8:

       x = "B"

   elif s > 0.7:

       x = "C"

   elif s > 0.6:

       x = "D"

   elif s <= 0.6:

       x = "F"

   return print(x)

Score = input('Enter score: ')

try:

   Score = float(Score)

   computegrade(Score)

except:

   print("Enter numbers only")

Similar questions