← Back to User Input
Question 3
Letter Grade Function
Letter Grade Function
Write a function letter_grade(mark: float) -> str that returns A for a mark of 80 or more, B from 70 up to but not including 80, C from 60, D from 50, and F below 50, using one if / elif / else chain. Do NOT write a main block or any top-level test code; the tests construct the calls. Input: one line, the mark as a decimal number, which the tests read and pass to your function before printing the letter it returns.
Expected Output:
A= newline. The output ends with a newline — print one after the last line.
Hints4 available
Sign in to use hintsTopics:
User InputType Hints
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.