diff --git a/python-intro/solutions/ex12_for_loops.ipynb b/python-intro/solutions/ex12_for_loops.ipynb index f73ec36..0a5b81f 100644 --- a/python-intro/solutions/ex12_for_loops.ipynb +++ b/python-intro/solutions/ex12_for_loops.ipynb @@ -217,16 +217,10 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 1, "id": "822b49d8-e5fe-42e9-b99b-0e67c09d18fd", "metadata": { "editable": true, - "execution": { - "iopub.execute_input": "2023-10-23T10:35:25.961126Z", - "iopub.status.busy": "2023-10-23T10:35:25.960684Z", - "iopub.status.idle": "2023-10-23T10:35:25.967160Z", - "shell.execute_reply": "2023-10-23T10:35:25.966241Z" - }, "slideshow": { "slide_type": "" }, @@ -244,6 +238,7 @@ } ], "source": [ + "# This reverses the order of the string because we are going through the word a character at a time and appending each character to the start of the string - i.e. s, o+s, f+os, etc. Take a look at the value of result in each iteration of the loop.\n", "original = \"software carpentry\"\n", "result = \"\"\n", "for character in original:\n", @@ -396,7 +391,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.5" + "version": "3.11.9" } }, "nbformat": 4,