In: Computer Science
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.
A: 90% - 100%
B 80% - 89%
C 70% - 79%
D 60% - 69%
F <60%
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
Required program in python -->
while True: #while loop executes
try:
marks=int(input("Enter your score: ")) #ask user for marks
except ValueError:
print("Please enter a numeric score ") #if string then print enter
a value
else:
break #else break
if(marks>=0 and marks<=100): #if marks in
between 0 to 100
if(marks>=90 and marks<=100): #if marks in
between 90-100
print("Letter grade: A") #print A
elif(marks>=80 and marks<=89 ): #if marks in between
80-89
print("Letter grade: B") #print B
elif(marks>=70 and marks<=79 ): #if marks in between
70-79
print("Letter grade: C") #print C
elif(marks>=60 and marks<=69 ): #if marks in between
60-69
print("Letter grade: D") #print D
else:
print("Letter grade: F") #else print F
else:
print("Please Enter in range 0-100") #else print enter in range
0-100