I got a problem with this exercise, I’ve been trying a lot of different codes and combinations, but it always says that the letter should be another than the one I’m getting as an answer.
In the workspace to your right, there is the outline of a function called grade_converter().
The purpose of this function is to take a number grade (1-100), defined by the variable grade, and to return the appropriate letter grade (A, B, C, D, or F).
Your task is to complete the function by creating appropriate if and elif statements that will compare the input grade with a number and then return a letter grade.
Your function should return the following letter grades:
90 or higher should get an "A"
80 - 89 should get a "B"
70 - 79 should get a "C"
65 - 69 should get a "D"
Anything below a 65 should receive an “F”
Be careful with your indentation—grade_converter() is a function (which we’ll get to in the next unit), and as you can see from the comment, function blocks are indented the same way if, elif, and else blocks are.
If you are having trouble creating the if and elif statements, here’s the first one you can use as an example:
if grade >= 90:
This will compare the variable grade with the value 90 and if it is greater than or equal to 90 it will return the letter A.