diff --git a/exercises/concept/making-the-grade/.docs/hints.md b/exercises/concept/making-the-grade/.docs/hints.md index 3e8deff958..8ee2ec6c34 100644 --- a/exercises/concept/making-the-grade/.docs/hints.md +++ b/exercises/concept/making-the-grade/.docs/hints.md @@ -22,7 +22,7 @@ Also being familiar with the following can help with completing the tasks: ## 2. Non-Passing Students - There's no need to declare `loop` counters or `index` counters when iterating through an object using a `for` loop. -- A results counter does need to be set up and _incremented_ -- you'll want to `return` the count of non-passing students when the loop terminates. + ## 3. The "Best" @@ -34,7 +34,6 @@ Also being familiar with the following can help with completing the tasks: - These are _lower thresholds_. The _lower threshold_ for a "D" is a score of **41**, since an "F" is **<= 40**. - [`range()`][range] can be helpful here to generate a sequence with the proper "F" -> "A" increments. -- [`round()`][round] without parameters should round off increments nicely. - As with "the best" task, `.append()` could be useful here to append items from `range()` into a results `list`. ## 5. Matching Names to Scores @@ -45,7 +44,6 @@ Also being familiar with the following can help with completing the tasks: ## 6. A "Perfect" Score - There may be or may not be a student with a score of 100, and you can't return `[]` without checking **all** scores. -- The [`control flow`][control flow] statements `continue` and `break` may be useful here to move past unwanted values. [append and pop]: https://docs.python.org/3/tutorial/datastructures.html#more-on-lists [control flow]: https://docs.python.org/3/tutorial/controlflow.html#break-and-continue-statements-and-else-clauses-on-loops diff --git a/exercises/concept/making-the-grade/.docs/introduction.md b/exercises/concept/making-the-grade/.docs/introduction.md index 2ae6ea724d..f3ecdd877d 100644 --- a/exercises/concept/making-the-grade/.docs/introduction.md +++ b/exercises/concept/making-the-grade/.docs/introduction.md @@ -10,23 +10,6 @@ The keywords `break`, `continue`, and `else` help customize loop behavior. [`while`][while statement] loops will continue to execute as long as the `loop expression` or "test" evaluates to `True` in a [`boolean context`][truth value testing], terminating when it evaluates to `False`: -```python - -# Lists are considered "truthy" in a boolean context if they -# contain one or more values, and "falsy" if they are empty. - ->>> placeholders = ["spam", "ham", "eggs", "green_spam", "green_ham", "green_eggs"] - ->>> while placeholders: -... print(placeholders.pop(0)) -... -'spam' -'ham' -'eggs' -'green_spam' -'green_ham' -'green_eggs' -``` ## For @@ -135,21 +118,6 @@ If both values and their indexes are needed, the built-in [`enumerate( The [`continue`][continue statement] keyword can be used to skip forward to the next iteration cycle: -```python -word_list = ["bird", "chicken", "barrel", "bongo", "sliver", "apple", "bear"] - -# This will skip *bird*, at index 0 -for index, word in enumerate(word_list): - if index == 0: - continue - if word.startswith("b"): - print(f"{word.title()} (at index {index}) starts with a b.") - -'Barrel (at index 2) starts with a b.' -'Bongo (at index 3) starts with a b.' -'Bear (at index 6) starts with a b.' -``` - The [`break`][break statement] (_like in many C-related languages_) keyword can be used to stop the iteration and "break out" of the innermost enclosing `loop`: diff --git a/exercises/concept/making-the-grade/.meta/exemplar.py b/exercises/concept/making-the-grade/.meta/exemplar.py index 5aa7508400..4c25865217 100644 --- a/exercises/concept/making-the-grade/.meta/exemplar.py +++ b/exercises/concept/making-the-grade/.meta/exemplar.py @@ -24,7 +24,7 @@ def count_failed_students(student_scores): non_passing = 0 for score in student_scores: if score <= 40: - non_passing += 1 + non_passing += 2 return non_passing