From 75f4f256e2ff626073eae69c31aaf50ba205d3db Mon Sep 17 00:00:00 2001 From: BethanyG Date: Mon, 11 May 2026 11:20:16 -0700 Subject: [PATCH 1/2] Updated docstrings in stub file to Google style. --- exercises/concept/making-the-grade/loops.py | 50 ++++++++++++++------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/exercises/concept/making-the-grade/loops.py b/exercises/concept/making-the-grade/loops.py index ecf7d06774c..21da8c77e8a 100644 --- a/exercises/concept/making-the-grade/loops.py +++ b/exercises/concept/making-the-grade/loops.py @@ -4,8 +4,11 @@ def round_scores(student_scores): """Round all provided student scores. - :param student_scores: list - float or int of student exam scores. - :return: list - student scores *rounded* to nearest integer value. + Parameters: + student_scores (list[float|int]): Student exam scores. + + Returns: + list[int]: Student scores *rounded* to the nearest integer value. """ pass @@ -14,8 +17,11 @@ def round_scores(student_scores): def count_failed_students(student_scores): """Count the number of failing students out of the group provided. - :param student_scores: list - containing int student scores. - :return: int - count of student scores at or below 40. + Parameters: + student_scores (list[int]): Student scores as ints. + + Returns: + int: The count of student scores at or below 40. """ pass @@ -24,9 +30,12 @@ def count_failed_students(student_scores): def above_threshold(student_scores, threshold): """Determine how many of the provided student scores were 'the best' based on the provided threshold. - :param student_scores: list - of integer scores. - :param threshold: int - threshold to cross to be the "best" score. - :return: list - of integer scores that are at or above the "best" threshold. + Parameters: + student_scores (list[int]): Integer scores. + threshold (int): The threshold to cross to be the "best" score. + + Returns: + list[int]: Integer scores that are at or above the "best" threshold. """ pass @@ -35,11 +44,14 @@ def above_threshold(student_scores, threshold): def letter_grades(highest): """Create a list of grade thresholds based on the provided highest grade. - :param highest: int - value of highest exam score. - :return: list - of lower threshold scores for each D-A letter grade interval. - For example, where the highest score is 100, and failing is <= 40, - The result would be [41, 56, 71, 86]: + Parameters: + highest: int - value of the highest exam score. + Returns: + list[int]: Lower threshold scores for each D-A letter grade interval. + + For example, where the highest score is 100, and failing is <= 40, + The result would be [41, 56, 71, 86]: 41 <= "D" <= 55 56 <= "C" <= 70 71 <= "B" <= 85 @@ -52,9 +64,12 @@ def letter_grades(highest): def student_ranking(student_scores, student_names): """Organize the student's rank, name, and grade information in descending order. - :param student_scores: list - of scores in descending order. - :param student_names: list - of string names by exam score in descending order. - :return: list - of strings in format [". : "]. + Parameters: + student_scores (list): Scores in descending order. + student_names (list[str]): Student names by exam score in descending order. + + Returns: + list[str]: Strings in format [". : "]. """ pass @@ -63,8 +78,11 @@ 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 [, ] lists. - :return: list - first `[, 100]` or `[]` if no student score of 100 is found. + Parameters: + student_info (list[list[str, int]]): List of [, ] lists. + + Returns: + list: First `[, 100]` found OR `[]` if no student score of 100 is found. """ pass From faf35248cd8081224407537a1253603ed17ac1bd Mon Sep 17 00:00:00 2001 From: BethanyG Date: Mon, 11 May 2026 12:02:51 -0700 Subject: [PATCH 2/2] Updated docstrings in exemplar to use Google style. --- .../making-the-grade/.meta/exemplar.py | 52 +++++++++++++------ 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/exercises/concept/making-the-grade/.meta/exemplar.py b/exercises/concept/making-the-grade/.meta/exemplar.py index 5aa75084005..c490dbf1c64 100644 --- a/exercises/concept/making-the-grade/.meta/exemplar.py +++ b/exercises/concept/making-the-grade/.meta/exemplar.py @@ -4,8 +4,11 @@ def round_scores(student_scores): """Round all provided student scores. - :param student_scores: list - float or int of student exam scores. - :return: list - student scores *rounded* to nearest integer value. + Parameters: + student_scores (list[float|int]): Student exam scores. + + Returns: + list[int]: Student scores *rounded* to the nearest integer value. """ rounded = [] @@ -17,8 +20,11 @@ def round_scores(student_scores): def count_failed_students(student_scores): """Count the number of failing students out of the group provided. - :param student_scores: list - containing int student scores. - :return: int - count of student scores at or below 40. + Parameters: + student_scores (list[int]): Student scores as ints. + + Returns: + int: The count of student scores at or below 40. """ non_passing = 0 @@ -31,9 +37,12 @@ def count_failed_students(student_scores): def above_threshold(student_scores, threshold): """Determine how many of the provided student scores were 'the best' based on the provided threshold. - :param student_scores: list - of integer scores. - :param threshold: int - threshold to cross to be the "best" score. - :return: list - of integer scores that are at or above the "best" threshold. + Parameters: + student_scores (list[int]): Integer scores. + threshold (int): The threshold to cross to be the "best" score. + + Returns: + list[int]: Integer scores that are at or above the "best" threshold. """ above = [] @@ -47,11 +56,14 @@ def above_threshold(student_scores, threshold): def letter_grades(highest): """Create a list of grade thresholds based on the provided highest grade. - :param highest: int - value of highest exam score. - :return: list - of lower threshold scores for each D-A letter grade interval. - For example, where the highest score is 100, and failing is <= 40, - The result would be [41, 56, 71, 86]: + Parameters: + highest: int - value of the highest exam score. + Returns: + list[int]: Lower threshold scores for each D-A letter grade interval. + + For example, where the highest score is 100, and failing is <= 40, + The result would be [41, 56, 71, 86]: 41 <= "D" <= 55 56 <= "C" <= 70 71 <= "B" <= 85 @@ -66,11 +78,14 @@ def letter_grades(highest): def student_ranking(student_scores, student_names): - """Organize the student's rank, name, and grade information in ascending order. + """Organize the student's rank, name, and grade information in descending order. + + Parameters: + student_scores (list): Scores in descending order. + student_names (list[str]): Student names by exam score in descending order. - :param student_scores: list - of scores in descending order. - :param student_names: list - of string names by exam score in descending order. - :return: list - of strings in format [". : "]. + Returns: + list[str]: Strings in format [". : "]. """ results = [] @@ -84,8 +99,11 @@ 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 [, ] lists. - :return: list - first `[, 100]` or `[]` if no student score of 100 is found. + Parameters: + student_info (list[list[str, int]]): List of [, ] lists. + + Returns: + list: First `[, 100]` found OR `[]` if no student score of 100 is found. """ result = []