diff --git a/examples/ch05/snippets_ipynb/05_09.ipynb b/examples/ch05/snippets_ipynb/05_09.ipynb index 289fe9e..87576fd 100755 --- a/examples/ch05/snippets_ipynb/05_09.ipynb +++ b/examples/ch05/snippets_ipynb/05_09.ipynb @@ -148,7 +148,7 @@ "outputs": [], "source": [ "if key in numbers:\n", - " print(f'found {key} at index {numbers.index(search_key)}')\n", + " print(f'found {key} at index {numbers.index(key)}')\n", "else:\n", " print(f'{key} not found')" ] @@ -204,4 +204,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file diff --git a/examples/ch05/snippets_py/05_09.py b/examples/ch05/snippets_py/05_09.py index 7f7765e..60739bc 100755 --- a/examples/ch05/snippets_py/05_09.py +++ b/examples/ch05/snippets_py/05_09.py @@ -29,7 +29,7 @@ key = 1000 if key in numbers: - print(f'found {key} at index {numbers.index(search_key)}') + print(f'found {key} at index {numbers.index(key)}') else: print(f'{key} not found')