Created
August 30, 2021 06:19
-
-
Save pamelafox/b15efa154ecf33ec78012e759575c1a2 to your computer and use it in GitHub Desktop.
Grade Assigner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Write a function named assign_grade that: | |
* takes 1 argument, an integer representing the score. | |
* returns a grade for the score, either "A" (90-100), "B" (80-89), "C" (70-79), "D" (65-69), or "F" (0-64). | |
Call that function for a few different scores and log the result to make sure it works. | |
""" | |
def assign_grade(score): | |
""" | |
>>> assign_grade(95) | |
'A' | |
>>> assign_grade(90) | |
'A' | |
>>> assign_grade(85) | |
'B' | |
>>> assign_grade(80) | |
'B' | |
>>> assign_grade(77) | |
'C' | |
>>> assign_grade(70) | |
'C' | |
>>> assign_grade(68) | |
'D' | |
>>> assign_grade(65) | |
'D' | |
>>> assign_grade(64) | |
'F' | |
>>> assign_grade(0) | |
'F' | |
""" | |
return '' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment