You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: exercises/concept/making-the-grade/.docs/instructions.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ You decide to make things a little more interesting by putting together some fun
9
9
While you can give "partial credit" on exam questions, overall exam scores have to be `int`s.
10
10
So before you can do anything else with the class scores, you need to go through the grades and turn any `float` scores into `int`s. Lucky for you, Python has the built-in [`round()`][round] function you can use.
11
11
12
-
Create the function `round_scores()` that takes a `list` of `student_scores`.
12
+
Create the function `round_scores(student_scores)` that takes a `list` of `student_scores`.
13
13
This function should _consume_ the input `list` and `return` a new list with all the scores converted to `int`s.
14
14
The order of the scores in the resulting `list` is not important.
15
15
@@ -22,10 +22,10 @@ The order of the scores in the resulting `list` is not important.
22
22
23
23
## 2. Non-Passing Students
24
24
25
-
As you were grading the exam, you noticed some students weren't performing as well as you'd hoped.
25
+
As you were grading the exam, you noticed some students weren't performing as well as you had hoped.
26
26
But you were distracted, and forgot to note exactly _how many_ students.
27
27
28
-
Create the function `count_failed_students()` that takes a `list` of `student_scores`.
28
+
Create the function `count_failed_students(student_scores)` that takes a `list` of `student_scores`.
29
29
This function should count up the number of students who don't have passing scores and return that count as an integer.
30
30
A student needs a score greater than **40** to achieve a passing grade on the exam.
31
31
@@ -39,7 +39,7 @@ A student needs a score greater than **40** to achieve a passing grade on the ex
39
39
The teacher you're assisting wants to find the group of students who've performed "the best" on this exam.
40
40
What qualifies as "the best" fluctuates, so you need to find the student scores that are **greater than or equal to** the current threshold.
41
41
42
-
Create the function `above_threshold()` taking `student_scores` (a `list` of grades), and `threshold` (the "top score" threshold) as parameters.
42
+
Create the function `above_threshold(student_scores)` taking `student_scores` (a `list` of grades), and `threshold` (the "top score" threshold) as parameters.
43
43
This function should return a `list` of all scores that are `>=` to `threshold`.
44
44
45
45
```python
@@ -49,10 +49,11 @@ This function should return a `list` of all scores that are `>=` to `threshold`.
49
49
50
50
## 4. Calculating Letter Grades
51
51
52
-
The teacher you're assisting likes to assign letter grades as well as numeric scores.
52
+
The teacher you are assisting likes to assign letter grades as well as numeric scores.
53
53
Since students rarely score 100 on an exam, the "letter grade" lower thresholds are calculated based on the highest score achieved, and increment evenly between the high score and the failing threshold of **<= 40**.
54
54
55
-
Create the function `letter_grades()` that takes the "highest" score on the exam as a parameter, and returns a `list` of lower score thresholds for each "American style" grade interval: `["D", "C", "B", "A"]`.
55
+
Create the function `letter_grades(highest)` that takes the "highest" score on the exam as an argument, and returns a `list` of lower score thresholds for each "American style" grade interval: `["D", "C", "B", "A"]`.
56
+
56
57
57
58
```python
58
59
"""Where the highest score is 100, and failing is <= 40.
@@ -84,7 +85,7 @@ Create the function `letter_grades()` that takes the "highest" score on the exam
84
85
You have a list of exam scores in descending order, and another list of student names also sorted in descending order by their exam scores.
85
86
You would like to match each student name with their exam score and print out an overall class ranking.
86
87
87
-
Create the function `student_ranking()` with parameters `student_scores` and `student_names`.
88
+
Create the function `student_ranking(student_scores)` with parameters `student_scores` and `student_names`.
88
89
Match each student name on the student_names `list` with their score from the student_scores `list`.
89
90
You can assume each argument `list` will be sorted from highest score(er) to lowest score(er).
90
91
The function should return a `list` of strings with the format `<rank>. <student name>: <student score>`.
@@ -101,7 +102,7 @@ The function should return a `list` of strings with the format `<rank>. <student
101
102
102
103
Although a "perfect" score of 100 is rare on an exam, it is interesting to know if at least one student has achieved it.
103
104
104
-
Create the function `perfect_score()` with parameter `student_info`.
105
+
Create the function `perfect_score(student_info)` with parameter `student_info`.
105
106
`student_info` is a `list` of lists containing the name and score of each student: `[["Charles", 90], ["Tony", 80]]`.
106
107
The function should `return`_the first_`[<name>, <score>]` pair of the student who scored 100 on the exam.
0 commit comments