diff --git a/002-basic-control-structures/Basic control structures.ipynb b/002-basic-control-structures/Basic control structures.ipynb index 3aeaea5..7b736e2 100644 --- a/002-basic-control-structures/Basic control structures.ipynb +++ b/002-basic-control-structures/Basic control structures.ipynb @@ -1117,12 +1117,24 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "ZeroDivisionError", + "evalue": "division by zero", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mZeroDivisionError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[1], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m y \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m120\u001b[39m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m z \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(\u001b[38;5;241m5\u001b[39m):\n\u001b[0;32m----> 3\u001b[0m y \u001b[38;5;241m=\u001b[39m \u001b[43my\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m/\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mz\u001b[49m\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mWhen z is\u001b[39m\u001b[38;5;124m\"\u001b[39m, z, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mthen y is\u001b[39m\u001b[38;5;124m\"\u001b[39m, y)\n", + "\u001b[0;31mZeroDivisionError\u001b[0m: division by zero" + ] + } + ], "source": [ "y = 120\n", - "for z in range(1, 5, 2):\n", + "for z in range(5):\n", " y = y / z\n", " print(\"When z is\", z, \"then y is\", y)" ] @@ -2546,7 +2558,7 @@ "metadata": { "celltoolbar": "Slideshow", "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -2560,7 +2572,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.11" + "version": "3.11.6" }, "livereveal": { "theme": "beige", @@ -2568,5 +2580,5 @@ } }, "nbformat": 4, - "nbformat_minor": 1 + "nbformat_minor": 4 }