Skip to content

Commit c5bfa4c

Browse files
authored
[Making the Grade]: Modified Test Error Messages & Touched Up Docs (#3542)
* Updated test error messages and touched up docs. * Removed deep copy from imports, as it was unneeded. [no important files changed]
1 parent 2e407c7 commit c5bfa4c

File tree

5 files changed

+157
-101
lines changed

5 files changed

+157
-101
lines changed

concepts/loops/about.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,17 +235,17 @@ The loop [`else` clause][loop else] is unique to Python and can be used for "wra
235235
'Found an S, stopping iteration.'
236236
```
237237

238-
[loop else]: https://docs.python.org/3/tutorial/controlflow.html#break-and-continue-statements-and-else-clauses-on-loops
239-
[range]: https://docs.python.org/3/library/stdtypes.html#range
240238
[break statement]: https://docs.python.org/3/reference/simple_stmts.html#the-break-statement
239+
[common sequence operations]: https://docs.python.org/3/library/stdtypes.html#common-sequence-operations
241240
[continue statement]: https://docs.python.org/3/reference/simple_stmts.html#the-continue-statement
242-
[while statement]: https://docs.python.org/3/reference/compound_stmts.html#the-while-statement
243-
[truth value testing]: https://docs.python.org/3/library/stdtypes.html#truth-value-testing
244241
[enumerate]: https://docs.python.org/3/library/functions.html#enumerate
245-
[iterator]: https://docs.python.org/3/glossary.html#term-iterator
246-
[common sequence operations]: https://docs.python.org/3/library/stdtypes.html#common-sequence-operations
247-
[range is not an iterator]: https://treyhunner.com/2018/02/python-range-is-not-an-iterator/
248242
[for statement]: https://docs.python.org/3/reference/compound_stmts.html#for
249243
[iterable]: https://docs.python.org/3/glossary.html#term-iterable
244+
[iterator]: https://docs.python.org/3/glossary.html#term-iterator
245+
[loop else]: https://docs.python.org/3/tutorial/controlflow.html#break-and-continue-statements-and-else-clauses-on-loops
250246
[next built-in]: https://docs.python.org/3/library/functions.html#next
247+
[range is not an iterator]: https://treyhunner.com/2018/02/python-range-is-not-an-iterator/
248+
[range]: https://docs.python.org/3/library/stdtypes.html#range
251249
[stopiteration]: https://docs.python.org/3/library/exceptions.html#StopIteration
250+
[truth value testing]: https://docs.python.org/3/library/stdtypes.html#truth-value-testing
251+
[while statement]: https://docs.python.org/3/reference/compound_stmts.html#the-while-statement

exercises/concept/making-the-grade/.docs/hints.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
## General
44

5-
- `while` loops are used for _indefinite_ (uncounted) iteration
6-
- `for` loops are used for _definite_, (counted) iteration.
7-
- The keywords `break` and `continue` help customize loop behavior.
8-
- `range(<start>, stop, <step>)` can be used to generate a sequence for a loop counter.
9-
- The built-in `enumerate()` will return (`<value>`, `<index>`) pairs to iterate over.
5+
- [`while`][while-loops] loops are used for _indefinite_ (uncounted) iteration
6+
- [`for`][for-loops] loops are used for _definite_, (counted) iteration.
7+
- The keywords [`break` and `continue`][control flow] help customize loop behavior.
8+
- [`range(<start>, stop, <step>)`][range] can be used to generate a sequence for a loop counter.
9+
- The built-in [`enumerate()`][enumerate] will return (`<value>`, `<index>`) pairs to iterate over.
1010

1111
Also being familiar with the following can help with completing the tasks:
1212

@@ -47,11 +47,13 @@ Also being familiar with the following can help with completing the tasks:
4747
- There may be or may not be a student with a score of 100, and you can't return `[]` without checking **all** scores.
4848
- The [`control flow`][control flow] statements `continue` and `break` may be useful here to move past unwanted values.
4949

50-
[list]: https://docs.python.org/3/library/stdtypes.html#list
51-
[str]: https://docs.python.org/3/library/stdtypes.html#str
52-
[f-strings]: https://docs.python.org/3/reference/lexical_analysis.html#formatted-string-literals
5350
[append and pop]: https://docs.python.org/3/tutorial/datastructures.html#more-on-lists
54-
[enumerate]: https://docs.python.org/3/library/functions.html#enumerate
5551
[control flow]: https://docs.python.org/3/tutorial/controlflow.html#break-and-continue-statements-and-else-clauses-on-loops
52+
[enumerate]: https://docs.python.org/3/library/functions.html#enumerate
53+
[f-strings]: https://docs.python.org/3/reference/lexical_analysis.html#formatted-string-literals
54+
[for-loops]: https://docs.python.org/3/tutorial/controlflow.html#for-statements
55+
[list]: https://docs.python.org/3/library/stdtypes.html#list
5656
[range]: https://docs.python.org/3/tutorial/controlflow.html#the-range-function
5757
[round]: https://docs.python.org/3/library/functions.html#round
58+
[str]: https://docs.python.org/3/library/stdtypes.html#str
59+
[while-loops]: https://docs.python.org/3/reference/compound_stmts.html#the-while-statement

exercises/concept/making-the-grade/.docs/instructions.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You decide to make things a little more interesting by putting together some fun
99
While you can give "partial credit" on exam questions, overall exam scores have to be `int`s.
1010
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.
1111

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`.
1313
This function should _consume_ the input `list` and `return` a new list with all the scores converted to `int`s.
1414
The order of the scores in the resulting `list` is not important.
1515

@@ -22,10 +22,10 @@ The order of the scores in the resulting `list` is not important.
2222

2323
## 2. Non-Passing Students
2424

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.
2626
But you were distracted, and forgot to note exactly _how many_ students.
2727

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`.
2929
This function should count up the number of students who don't have passing scores and return that count as an integer.
3030
A student needs a score greater than **40** to achieve a passing grade on the exam.
3131

@@ -39,7 +39,7 @@ A student needs a score greater than **40** to achieve a passing grade on the ex
3939
The teacher you're assisting wants to find the group of students who've performed "the best" on this exam.
4040
What qualifies as "the best" fluctuates, so you need to find the student scores that are **greater than or equal to** the current threshold.
4141

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.
4343
This function should return a `list` of all scores that are `>=` to `threshold`.
4444

4545
```python
@@ -49,10 +49,11 @@ This function should return a `list` of all scores that are `>=` to `threshold`.
4949

5050
## 4. Calculating Letter Grades
5151

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.
5353
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**.
5454

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+
5657

5758
```python
5859
"""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
8485
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.
8586
You would like to match each student name with their exam score and print out an overall class ranking.
8687

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`.
8889
Match each student name on the student_names `list` with their score from the student_scores `list`.
8990
You can assume each argument `list` will be sorted from highest score(er) to lowest score(er).
9091
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
101102

102103
Although a "perfect" score of 100 is rare on an exam, it is interesting to know if at least one student has achieved it.
103104

104-
Create the function `perfect_score()` with parameter `student_info`.
105+
Create the function `perfect_score(student_info)` with parameter `student_info`.
105106
`student_info` is a `list` of lists containing the name and score of each student: `[["Charles", 90], ["Tony", 80]]`.
106107
The function should `return` _the first_ `[<name>, <score>]` pair of the student who scored 100 on the exam.
107108

exercises/concept/making-the-grade/.docs/introduction.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,13 @@ The [`break`][break statement] (_like in many C-related languages_) keyword can
172172
'loop broken.'
173173
```
174174

175-
[for statement]: https://docs.python.org/3/reference/compound_stmts.html#for
176-
[range]: https://docs.python.org/3/library/stdtypes.html#range
177175
[break statement]: https://docs.python.org/3/reference/simple_stmts.html#the-break-statement
176+
[common sequence operations]: https://docs.python.org/3/library/stdtypes.html#common-sequence-operations
178177
[continue statement]: https://docs.python.org/3/reference/simple_stmts.html#the-continue-statement
179-
[while statement]: https://docs.python.org/3/reference/compound_stmts.html#the-while-statement
180-
[iterable]: https://docs.python.org/3/glossary.html#term-iterable
181-
[truth value testing]: https://docs.python.org/3/library/stdtypes.html#truth-value-testing
182178
[enumerate]: https://docs.python.org/3/library/functions.html#enumerate
183-
[common sequence operations]: https://docs.python.org/3/library/stdtypes.html#common-sequence-operations
179+
[for statement]: https://docs.python.org/3/reference/compound_stmts.html#for
180+
[iterable]: https://docs.python.org/3/glossary.html#term-iterable
184181
[next built-in]: https://docs.python.org/3/library/functions.html#next
182+
[range]: https://docs.python.org/3/library/stdtypes.html#range
183+
[truth value testing]: https://docs.python.org/3/library/stdtypes.html#truth-value-testing
184+
[while statement]: https://docs.python.org/3/reference/compound_stmts.html#the-while-statement

0 commit comments

Comments
 (0)