0% found this document useful (0 votes)
14 views2 pages

Presentation 1

The code takes a numeric score as input, checks if it is between 0 and 1, and prints the corresponding letter grade based on thresholds for A through F.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views2 pages

Presentation 1

The code takes a numeric score as input, checks if it is between 0 and 1, and prints the corresponding letter grade based on thresholds for A through F.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

score = float(input("Enter a score between 0.0 and 1.

0: "))
if score < 0.0 or score > 1.0:
print("Error: Score is out of range.")
elif score >= 0.9:
print("Grade: A")
elif score >= 0.8:
print("Grade: B")
elif score >= 0.7:
print("Grade: C")
elif score >= 0.6:
print("Grade: D")
else:
print("Grade: F")

You might also like