Repository navigation
Description
Describe the Issue
The binary search workshop has wording, code-formatting, and solution-indentation problems:
-
Step 1 (
683ec39565dbc7e3375263b1) uses a singular article before two parameters in both the description and hint:To begin, create a `binary_search` function with a `search_list` and `value` parameters.Your `binary_search` function should have a `search_list` and `value` parameters.The article
adoes not agree with the pluralparameters. -
Step 4 (
683ec95f2f8781355556ff7c) leaves one occurrence ofhighwithout code formatting:Inside the `binary_search` function, create a `while` loop with a condition that checks if `low` is less than or equal to high. Inside the loop, add the `pass` keyword as a placeholder for now.This is inconsistent with the formatting of
lowand the other occurrences ofhighin the same description. -
Step 12 (
683ec95f2f8781355556ff84) misdescribes how updating the lower search boundary affects the search:This will extend the search to the right half of the current search areas in the list, because if the `value` is greater than `value_at_middle`, it means the `value` must be in the right half of the current search area.Updating
lownarrows the search range. It does not extend it. The comparison also does not establish that the target exists in the list. -
Step 16 (
68416d66013635cb6325eb6d) uses inconsistent indentation in the final solution:if value == value_at_middle: return path_to_target, f"Value found at index {mid}"
The return statement is indented only two spaces beyond its
ifstatement, while the surrounding Python code uses four spaces per indentation level.
Affected Pages
Expected behavior
The description and hint in Step 1 should describe the two parameters with correct grammar. Variable names in Step 4 should use consistent code formatting.
Step 12 should explain that the search narrows to the right half and that the target must be in that half only if it is present in the list.
The final solution in Step 16 should use consistent four-space indentation increments.
Activity