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
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
Math,
15 hours ago
Geography,
1 day ago
Social Sciences,
1 day ago
English,
8 months ago
English,
8 months ago