Making the Grade: Added summary sentences to each docstring in both code files
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
def round_scores(student_scores):
|
||||
"""
|
||||
"""Round all student scores in the provided list.
|
||||
|
||||
:param student_scores: list of student exam scores as float or int.
|
||||
:return: list of student scores *rounded* to nearest integer value.
|
||||
"""
|
||||
@@ -11,7 +12,8 @@ def round_scores(student_scores):
|
||||
|
||||
|
||||
def count_failed_students(student_scores):
|
||||
"""
|
||||
"""Count the number of failing students in the provided list.
|
||||
|
||||
:param student_scores: list of integer student scores.
|
||||
:return: integer count of student scores at or below 40.
|
||||
"""
|
||||
@@ -24,7 +26,8 @@ def count_failed_students(student_scores):
|
||||
|
||||
|
||||
def above_threshold(student_scores, threshold):
|
||||
"""
|
||||
"""Count the number of student scores and determine how many performed the best based on the provided threshold.
|
||||
|
||||
:param student_scores: list of integer scores
|
||||
:param threshold : integer
|
||||
:return: list of integer scores that are at or above the "best" threshold.
|
||||
@@ -39,10 +42,11 @@ def above_threshold(student_scores, threshold):
|
||||
|
||||
|
||||
def letter_grades(highest):
|
||||
"""Create a list of grade thresholds based on the provided highest grade.
|
||||
|
||||
:param highest: integer of highest exam score.
|
||||
:return: list of integer score thresholds for each F-A letter grades.
|
||||
"""
|
||||
:param highest: integer of highest exam score.
|
||||
:return: list of integer score thresholds for each F-A letter grades.
|
||||
"""
|
||||
|
||||
increment = round((highest - 40)/4)
|
||||
scores = []
|
||||
@@ -52,7 +56,8 @@ def letter_grades(highest):
|
||||
|
||||
|
||||
def student_ranking(student_scores, student_names):
|
||||
"""
|
||||
"""Create a list of strings that contain the student's rank, name, and grade in ascending order.
|
||||
|
||||
:param student_scores: list of scores in descending order.
|
||||
:param student_names: list of names in descending order by exam score.
|
||||
:return: list of strings in format ["<rank>. <student name>: <score>"].
|
||||
@@ -67,7 +72,8 @@ def student_ranking(student_scores, student_names):
|
||||
|
||||
|
||||
def perfect_score(student_info):
|
||||
"""
|
||||
"""Create a list that contains the name and grade of the first student to make a perfect score on the exam.
|
||||
|
||||
:param student_info: list of [<student name>, <score>] lists
|
||||
:return: first `[<student name>, 100]` or `[]` if no student score of 100 is found.
|
||||
"""
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
def round_scores(student_scores):
|
||||
"""
|
||||
"""Round all student scores in the provided list.
|
||||
|
||||
:param student_scores: list of student exam scores as float or int.
|
||||
:return: list of student scores *rounded* to nearest integer value.
|
||||
@@ -9,7 +9,7 @@ def round_scores(student_scores):
|
||||
|
||||
|
||||
def count_failed_students(student_scores):
|
||||
"""
|
||||
"""Count the number of failing students in the provided list.
|
||||
|
||||
:param student_scores: list of integer student scores.
|
||||
:return: integer count of student scores at or below 40.
|
||||
@@ -19,7 +19,7 @@ def count_failed_students(student_scores):
|
||||
|
||||
|
||||
def above_threshold(student_scores, threshold):
|
||||
"""
|
||||
"""Count the number of student scores and determine how many performed the best based on the provided threshold.
|
||||
|
||||
:param student_scores: list of integer scores
|
||||
:param threshold : integer
|
||||
@@ -30,7 +30,7 @@ def above_threshold(student_scores, threshold):
|
||||
|
||||
|
||||
def letter_grades(highest):
|
||||
"""
|
||||
"""Create a list of grade thresholds based on the provided highest grade.
|
||||
|
||||
:param highest: integer of highest exam score.
|
||||
:return: list of integer lower threshold scores for each D-A letter grade interval.
|
||||
@@ -47,7 +47,7 @@ def letter_grades(highest):
|
||||
|
||||
|
||||
def student_ranking(student_scores, student_names):
|
||||
"""
|
||||
"""Create a list of strings that contain the student's rank, name, and grade in ascending order.
|
||||
|
||||
:param student_scores: list of scores in descending order.
|
||||
:param student_names: list of names in descending order by exam score.
|
||||
@@ -58,7 +58,7 @@ def student_ranking(student_scores, student_names):
|
||||
|
||||
|
||||
def perfect_score(student_info):
|
||||
"""
|
||||
"""Create a list that contains the name and grade of the first student to make a perfect score on the exam.
|
||||
|
||||
:param student_info: list of [<student name>, <score>] lists
|
||||
:return: first `[<student name>, 100]` or `[]` if no student score of 100 is found.
|
||||
|
||||
Reference in New Issue
Block a user