Write a program IN PYTHON of the JUPYTER NOOTBOOK
Write a Python program that gets a numeric grade (on a scale of 0-100) from the user and convert it to a letter grade based on the following table.
Credit Score | Annual Intrest Rate |
500-649 | %15.5 |
650-729 | %9.5 |
730-800 | %4.5 |
The program should be written so that if the user entered either a non-numeric input or a numeric input out of the 0-100 range, it asks him/her to enter a numeric input in the correct range, instead of returning an error.
Example:
Enter your score: 78
Letter grade: C
Enter your score: seventy
Please enter a numeric score
try: score = int(input("Enter your score: ")) if score < 0 or score > 100: print("Please enter a numeric input out of the 0-100 range") else: if score >= 90: grade = 'A' elif score >= 80: grade = 'B' elif score >= 70: grade = 'C' elif score >= 60: grade = 'D' else: grade = 'F' print("Letter grade:", grade) except ValueError: print("Please enter a numeric score")
Get Answers For Free
Most questions answered within 1 hours.