Lecture

Coding Quiz - Determine Grade Using Conditional Statements

In this coding quiz, you will write a function that determines a grade based on a given score.

You will receive a score (integer) from the user and return the corresponding grade.

Grades are assigned based on the following criteria:

  • 90 and above: 'A'

  • 80 to 89: 'B'

  • 70 to 79: 'C'

  • 60 to 69: 'D'

  • Below 60: 'F'


Code Implementation
def solution(score): # Write your code here return



Constraints

  • The score received as input will be an integer between 0 and 100 inclusive.



Example Input and Output

  • Input: 95

  • Output: A


  • Input: 75

  • Output: C

Lecture

AI Tutor

Publish

Design

Upload

Notes

Favorites

Help