82.9k views
4 votes
Write a program to prompt for a score between 0.0 and 1.0. If the score is

out of range, print an error. If the score is between 0.0 and 1.0, print a grade
usmg the following table:
Score Grade
0.9 A
08 B
07
= 0.6 0
0.6
if the user enters a value out of range, print a suitable error message and exit.
For the test enter a score of 0.85.
Check Code
Reset Code​

User ToniBig
by
4.9k points

1 Answer

3 votes

score = float(input("Enter Score: "))

message = "Score out of range"

if score >= 0.9:

message = "A"

elif score >= 0.8:

message = "B"

elif score >= 0.7:

message = "C"

elif score >= 0.6:

message = "D"

elif score < 0.6:

message = "F"

else:

message = "Out of Range"

print(message)

I hope this helps!

User Jeffrey Eldredge
by
4.8k points