-
-
Notifications
You must be signed in to change notification settings - Fork 49.6k
Closed as not planned
Labels
awaiting triageAwaiting triage from a maintainerAwaiting triage from a maintainer
Description
What would you like to share?
def calculate_grade(score):
if score >= 90:
return 'A+'
elif score >= 80:
return 'A'
elif score >= 70:
return 'B'
elif score >= 60:
return 'C'
elif score>=50:
return 'D'
else:
return 'Fail'
Test the grading system
try:
score = float(input("Enter the numeric score: "))
if 0 <= score <= 100:
grade = calculate_grade(score)
print(f"The letter grade for the score {score} is: {grade}")
else:
print("Invalid score. Please enter a number between 0 and 100.")
except ValueError:
print("Invalid input. Please enter a valid numeric score.")
Additional information
No response
Metadata
Metadata
Assignees
Labels
awaiting triageAwaiting triage from a maintainerAwaiting triage from a maintainer