#54EasyConditionals· Ranges and Validation
Grade Calculator with Edge Cases
Input format
`score`: usually an int or float, but it may be any JSON value.
Output format
A string such as `"A- 3.7"`, or `"Invalid score"`.
Examples
Input: score = 90
Output: "A- 3.7"
90 meets the A- threshold exactly.
Input: score = 101
Output: "Invalid score"
Scores above 100 are rejected.
Constraints
- Valid scores lie in the closed range [0, 100]
Study first
- #python
- #conditionals
- #validation
- #isinstance
