From c1635695ef9156d3bcc8ca7bd5ade0024517dcb4 Mon Sep 17 00:00:00 2001 From: Julien Smith Date: Mon, 12 Jan 2026 22:10:11 -0800 Subject: [PATCH 1/6] wk2 ipython cur progress --- AD450_math.py | 5 + week_2_intro_ipython.ipynb | 195 ++++++++++++++++++++++++++++++++----- 2 files changed, 175 insertions(+), 25 deletions(-) create mode 100644 AD450_math.py diff --git a/AD450_math.py b/AD450_math.py new file mode 100644 index 0000000..357720a --- /dev/null +++ b/AD450_math.py @@ -0,0 +1,5 @@ +def add(num1, num2): + return num1 + num2 + +def multiply(num1, num2): + return num1 * num2 \ No newline at end of file diff --git a/week_2_intro_ipython.ipynb b/week_2_intro_ipython.ipynb index 1a469f7..b62b64d 100644 --- a/week_2_intro_ipython.ipynb +++ b/week_2_intro_ipython.ipynb @@ -28,8 +28,20 @@ "metadata": { "id": "BQybla17FRh5" }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "My name is Julien.\n", + "I am a student at North Seattle College\n" + ] + } + ], + "source": [ + "name = \"Julien\"\n", + "print(\"My name is \" + name + \".\\nI am a student at North Seattle College\")" + ] }, { "cell_type": "markdown", @@ -47,8 +59,19 @@ "metadata": { "id": "P7QDyWncFRh8" }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "My phone number is 2069991111\n" + ] + } + ], + "source": [ + "phone = 2069991111\n", + "print(\"My phone number is \" + str(phone))" + ] }, { "cell_type": "markdown", @@ -66,8 +89,21 @@ "metadata": { "id": "OnOau948FRh9" }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello my name is Julien and my phone number is 206-999-1111\n" + ] + } + ], + "source": [ + "name = \"Julien\"\n", + "phone_number = \"206-999-1111\"\n", + "\n", + "print(f\"Hello my name is {name} and my phone number is {phone_number}\")" + ] }, { "cell_type": "markdown", @@ -86,8 +122,20 @@ "metadata": { "id": "5x2rIFzRFRh9" }, - "outputs": [], - "source": [] + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "invalid syntax. Maybe you meant '==' or ':=' instead of '='? (1440112413.py, line 1)", + "output_type": "error", + "traceback": [ + " \u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[19]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[31m \u001b[39m\u001b[31mmonth = \"June\", year = 2027\u001b[39m\n ^\n\u001b[31mSyntaxError\u001b[39m\u001b[31m:\u001b[39m invalid syntax. Maybe you meant '==' or ':=' instead of '='?\n" + ] + } + ], + "source": [ + "month, year = \"June\", 2027\n", + "print(f\"I graduate in {month} of {year}\")" + ] }, { "cell_type": "markdown", @@ -113,8 +161,20 @@ "metadata": { "id": "OkyeAVPXFRh-" }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "58.5\n" + ] + } + ], + "source": [ + "ans = 12 * 5 - 3 / 2\n", + "print(ans)\n", + "# it is float because there are trailing decimals\n" + ] }, { "cell_type": "markdown", @@ -140,8 +200,24 @@ "metadata": { "id": "Lo-LEy8bKYmG" }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "31 days\n" + ] + } + ], + "source": [ + "month = \"October\"\n", + "\n", + "if month == \"October\":\n", + " print(\"31 days\")\n", + "else:\n", + " print(\"30 days\")\n", + " \n" + ] }, { "cell_type": "markdown", @@ -161,8 +237,25 @@ "metadata": { "id": "qscUkh813QKH" }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "between 100 and 150\n" + ] + } + ], + "source": [ + "num = 140\n", + "\n", + "if num > 150:\n", + " print(\"greater than 150\")\n", + "elif num > 100:\n", + " print(\"between 100 and 150\")\n", + "else:\n", + " print(\"less than 100\")" + ] }, { "cell_type": "markdown", @@ -181,8 +274,24 @@ "metadata": { "id": "1vxg4nMbFRh_" }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Number is divisible by 5 and 10\n", + "Number is divisible by 7 or 2\n" + ] + } + ], + "source": [ + "num = 70 \n", + "if num % 5 == 0 and num % 10 == 0:\n", + " print(\"Number is divisible by 5 and 10\")\n", + "\n", + "if num % 7 == 0 or num % 2 == 0:\n", + " print(\"Number is divisible by 7 or 2\")" + ] }, { "cell_type": "markdown", @@ -199,8 +308,34 @@ "metadata": { "id": "JY_Ci5v-FRiA" }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0\n", + "7\n", + "14\n", + "21\n", + "28\n", + "35\n", + "42\n", + "49\n", + "56\n", + "63\n", + "70\n", + "77\n", + "84\n", + "91\n", + "98\n" + ] + } + ], + "source": [ + "for i in range(0, 100):\n", + " if i % 7 == 0:\n", + " print(i)" + ] }, { "cell_type": "markdown", @@ -214,9 +349,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "id": "4a1D64hpFRiA" - }, + "metadata": {}, "outputs": [], "source": [] }, @@ -337,9 +470,21 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "ModuleNotFoundError", + "evalue": "No module named 'AD450_math'", + "output_type": "error", + "traceback": [ + "\u001b[31m---------------------------------------------------------------------------\u001b[39m", + "\u001b[31mModuleNotFoundError\u001b[39m Traceback (most recent call last)", + "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[33]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m \u001b[38;5;28;01mimport\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mAD450_math\u001b[39;00m\n\u001b[32m 3\u001b[39m AD450_math.add(\u001b[32m2\u001b[39m,\u001b[32m2\u001b[39m)\n", + "\u001b[31mModuleNotFoundError\u001b[39m: No module named 'AD450_math'" + ] + } + ], "source": [ "import AD450_math\n", "\n", @@ -431,7 +576,7 @@ "provenance": [] }, "kernelspec": { - "display_name": "my_env_2", + "display_name": "base", "language": "python", "name": "python3" }, @@ -445,7 +590,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.16" + "version": "3.13.5" } }, "nbformat": 4, From d434de3185a625991fd51c84ad607cb204fede85 Mon Sep 17 00:00:00 2001 From: Julien Smith Date: Mon, 12 Jan 2026 22:12:25 -0800 Subject: [PATCH 2/6] wk2 cur progress --- week_2_intro_ipython.ipynb | 196 +++++++++++++++++++++++++++---------- 1 file changed, 147 insertions(+), 49 deletions(-) diff --git a/week_2_intro_ipython.ipynb b/week_2_intro_ipython.ipynb index b62b64d..78bed5b 100644 --- a/week_2_intro_ipython.ipynb +++ b/week_2_intro_ipython.ipynb @@ -24,7 +24,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 22, "metadata": { "id": "BQybla17FRh5" }, @@ -55,7 +55,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 23, "metadata": { "id": "P7QDyWncFRh8" }, @@ -85,7 +85,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 24, "metadata": { "id": "OnOau948FRh9" }, @@ -118,17 +118,16 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 25, "metadata": { "id": "5x2rIFzRFRh9" }, "outputs": [ { - "ename": "SyntaxError", - "evalue": "invalid syntax. Maybe you meant '==' or ':=' instead of '='? (1440112413.py, line 1)", - "output_type": "error", - "traceback": [ - " \u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[19]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[31m \u001b[39m\u001b[31mmonth = \"June\", year = 2027\u001b[39m\n ^\n\u001b[31mSyntaxError\u001b[39m\u001b[31m:\u001b[39m invalid syntax. Maybe you meant '==' or ':=' instead of '='?\n" + "name": "stdout", + "output_type": "stream", + "text": [ + "I graduate in June of 2027\n" ] } ], @@ -157,7 +156,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 26, "metadata": { "id": "OkyeAVPXFRh-" }, @@ -196,7 +195,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 27, "metadata": { "id": "Lo-LEy8bKYmG" }, @@ -233,7 +232,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 28, "metadata": { "id": "qscUkh813QKH" }, @@ -270,7 +269,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 29, "metadata": { "id": "1vxg4nMbFRh_" }, @@ -304,7 +303,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 30, "metadata": { "id": "JY_Ci5v-FRiA" }, @@ -348,10 +347,29 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 173, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0 3 6 9 \n", + "18\n" + ] + } + ], + "source": [ + "i = 0\n", + "nums = \"\"\n", + "while i < 10: \n", + " if i % 3 == 0:\n", + " nums += str(i) + \" \"\n", + " sums = i + i \n", + " i += 1\n", + "print(nums)\n", + "print(sums)\n" + ] }, { "cell_type": "markdown", @@ -392,12 +410,27 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 174, "metadata": { "id": "lppms8ctzfRI" }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hogwarts\n", + "s\n" + ] + } + ], + "source": [ + "school = \"Hogwarts\"\n", + "first = school[0:3]\n", + "second = school[3:8]\n", + "print(first + second)\n", + "print(school[-1])" + ] }, { "cell_type": "markdown", @@ -413,12 +446,26 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 175, "metadata": { "id": "zw2NezoM0zfl" }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Thor is a character in the Marvel Cinematic Universe\n", + "She-Hulk is a character in the Marvel Cinematic Universe\n", + "Loki is a character in the Marvel Cinematic Universe\n" + ] + } + ], + "source": [ + "chars = [\"Thor\", \"She-Hulk\", \"Loki\"]\n", + "for char in chars:\n", + " print(char +\" is a character in the Marvel Cinematic Universe\")" + ] }, { "cell_type": "markdown", @@ -454,12 +501,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 176, "metadata": { "id": "p0YE0nqs4Hcz" }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'Breed': 'Corgi', 'Age': 13, 'Type': 'Cattle herding'}\n", + "Corgi\n", + "The Corgi is expected to live about 13 years\n" + ] + } + ], + "source": [ + "dog = {\n", + " \"Breed\": \"Corgi\",\n", + " \"Age\": 13,\n", + " \"Type\": \"Cattle herding\"\n", + "}\n", + "print(dog)\n", + "print(dog[\"Breed\"])\n", + "print(f\"The {dog['Breed']} is expected to live about {dog['Age']} years\")" + ] }, { "cell_type": "markdown", @@ -470,19 +536,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 177, "metadata": {}, "outputs": [ { - "ename": "ModuleNotFoundError", - "evalue": "No module named 'AD450_math'", - "output_type": "error", - "traceback": [ - "\u001b[31m---------------------------------------------------------------------------\u001b[39m", - "\u001b[31mModuleNotFoundError\u001b[39m Traceback (most recent call last)", - "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[33]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m \u001b[38;5;28;01mimport\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mAD450_math\u001b[39;00m\n\u001b[32m 3\u001b[39m AD450_math.add(\u001b[32m2\u001b[39m,\u001b[32m2\u001b[39m)\n", - "\u001b[31mModuleNotFoundError\u001b[39m: No module named 'AD450_math'" - ] + "data": { + "text/plain": [ + "4" + ] + }, + "execution_count": 177, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ @@ -504,9 +569,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 178, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "4" + ] + }, + "execution_count": 178, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "# Cell with import error\n", "AD450_math.multiply(2, 2)" @@ -514,18 +590,29 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 179, "metadata": {}, "outputs": [], "source": [ - "# Reload cell" + "# Reload cell\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 180, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "4" + ] + }, + "execution_count": 180, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "# Cell with correct output \n", "AD450_math.multiply(2, 2)" @@ -545,29 +632,40 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 181, "metadata": {}, "outputs": [], "source": [ - "# Create a" + "# Create a\n", + "a = 1 " ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 182, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1\n" + ] + } + ], "source": [ - "# Print a" + "# Print a\n", + "print(a)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 183, "metadata": {}, "outputs": [], "source": [ - "# Set a to 4" + "# Set a to 4\n", + "a = 4 " ] } ], From 05f432c0130db30076d3214938417fac71a476b5 Mon Sep 17 00:00:00 2001 From: Julien Smith Date: Mon, 12 Jan 2026 23:56:56 -0800 Subject: [PATCH 3/6] cur wk2 --- week_2_intro_ipython.ipynb | 54 +++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/week_2_intro_ipython.ipynb b/week_2_intro_ipython.ipynb index 78bed5b..b503869 100644 --- a/week_2_intro_ipython.ipynb +++ b/week_2_intro_ipython.ipynb @@ -347,7 +347,7 @@ }, { "cell_type": "code", - "execution_count": 173, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -361,11 +361,12 @@ ], "source": [ "i = 0\n", + "sums = 0\n", "nums = \"\"\n", "while i < 10: \n", " if i % 3 == 0:\n", " nums += str(i) + \" \"\n", - " sums = i + i \n", + " sums += i\n", " i += 1\n", "print(nums)\n", "print(sums)\n" @@ -410,7 +411,7 @@ }, { "cell_type": "code", - "execution_count": 174, + "execution_count": 3, "metadata": { "id": "lppms8ctzfRI" }, @@ -446,7 +447,7 @@ }, { "cell_type": "code", - "execution_count": 175, + "execution_count": 4, "metadata": { "id": "zw2NezoM0zfl" }, @@ -479,12 +480,29 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": { "id": "rbyZif9a1b2V" }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "janurary has 31 days\n", + "february has 28 days\n", + "march has 31 days\n", + "april has 30 days\n", + "may has 31 days\n", + "june has 30 days\n" + ] + } + ], + "source": [ + "months = [[\"janurary\", 31], [\"february\", 28], [\"march\", 31], [\"april\", 30], [\"may\", 31], [\"june\", 30]]\n", + "for i in range(len(months)):\n", + " print(f\"{months[i][0]} has {months[i][1]} days\")\n" + ] }, { "cell_type": "markdown", @@ -501,7 +519,7 @@ }, { "cell_type": "code", - "execution_count": 176, + "execution_count": 6, "metadata": { "id": "p0YE0nqs4Hcz" }, @@ -536,7 +554,7 @@ }, { "cell_type": "code", - "execution_count": 177, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -545,7 +563,7 @@ "4" ] }, - "execution_count": 177, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -569,7 +587,7 @@ }, { "cell_type": "code", - "execution_count": 178, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -578,7 +596,7 @@ "4" ] }, - "execution_count": 178, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -590,7 +608,7 @@ }, { "cell_type": "code", - "execution_count": 179, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ @@ -599,7 +617,7 @@ }, { "cell_type": "code", - "execution_count": 180, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -608,7 +626,7 @@ "4" ] }, - "execution_count": 180, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -632,7 +650,7 @@ }, { "cell_type": "code", - "execution_count": 181, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ @@ -642,7 +660,7 @@ }, { "cell_type": "code", - "execution_count": 182, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -660,7 +678,7 @@ }, { "cell_type": "code", - "execution_count": 183, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ From a6cbe4012399efbd2d5eeb638c31afc3e9105f98 Mon Sep 17 00:00:00 2001 From: Julien Smith Date: Tue, 13 Jan 2026 13:09:38 -0800 Subject: [PATCH 4/6] init wk 2 submission --- week_2_intro_ipython.ipynb | 49 +++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/week_2_intro_ipython.ipynb b/week_2_intro_ipython.ipynb index b503869..7746dc9 100644 --- a/week_2_intro_ipython.ipynb +++ b/week_2_intro_ipython.ipynb @@ -393,12 +393,27 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 39, "metadata": { "id": "ntBnYxzi1RPc" }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Student 2\n", + "Student 4\n" + ] + } + ], + "source": [ + "sets = [[1,], [2], [3], [4], [5]]\n", + "for i in sets:\n", + " for j in i:\n", + " if j % 2 == 0:\n", + " print(\"Student \" + str(j))\n" + ] }, { "cell_type": "markdown", @@ -411,7 +426,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 40, "metadata": { "id": "lppms8ctzfRI" }, @@ -447,7 +462,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 41, "metadata": { "id": "zw2NezoM0zfl" }, @@ -480,7 +495,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 42, "metadata": { "id": "rbyZif9a1b2V" }, @@ -519,7 +534,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 43, "metadata": { "id": "p0YE0nqs4Hcz" }, @@ -554,7 +569,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 44, "metadata": {}, "outputs": [ { @@ -563,7 +578,7 @@ "4" ] }, - "execution_count": 7, + "execution_count": 44, "metadata": {}, "output_type": "execute_result" } @@ -587,7 +602,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 45, "metadata": {}, "outputs": [ { @@ -596,7 +611,7 @@ "4" ] }, - "execution_count": 8, + "execution_count": 45, "metadata": {}, "output_type": "execute_result" } @@ -608,7 +623,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 46, "metadata": {}, "outputs": [], "source": [ @@ -617,7 +632,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 47, "metadata": {}, "outputs": [ { @@ -626,7 +641,7 @@ "4" ] }, - "execution_count": 10, + "execution_count": 47, "metadata": {}, "output_type": "execute_result" } @@ -650,7 +665,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 48, "metadata": {}, "outputs": [], "source": [ @@ -660,7 +675,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 49, "metadata": {}, "outputs": [ { @@ -678,7 +693,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 50, "metadata": {}, "outputs": [], "source": [ From 5610e6cf32049085e655f952172dfc8a492b1ec5 Mon Sep 17 00:00:00 2001 From: Julien Smith Date: Fri, 16 Jan 2026 17:10:43 -0800 Subject: [PATCH 5/6] initial submission From 35201735c9c3b6a80c07a4fcb63e962a8df8f666 Mon Sep 17 00:00:00 2001 From: Julien Smith Date: Fri, 16 Jan 2026 17:38:34 -0800 Subject: [PATCH 6/6] final submission for week 2 --- week_2_intro_ipython.ipynb | 79 ++++++++++++++++++++++++++++---------- 1 file changed, 58 insertions(+), 21 deletions(-) diff --git a/week_2_intro_ipython.ipynb b/week_2_intro_ipython.ipynb index 7746dc9..01bc8d3 100644 --- a/week_2_intro_ipython.ipynb +++ b/week_2_intro_ipython.ipynb @@ -393,7 +393,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 13, "metadata": { "id": "ntBnYxzi1RPc" }, @@ -402,17 +402,38 @@ "name": "stdout", "output_type": "stream", "text": [ + "Set: 1\n", + "Set: 2\n", + "Student 0\n", + "Student 1\n", "Student 2\n", - "Student 4\n" + "Student 3\n", + "Student 4\n", + "Set: 3\n", + "Set: 4\n", + "Student 0\n", + "Student 1\n", + "Student 2\n", + "Student 3\n", + "Student 4\n", + "Set: 5\n" ] } ], "source": [ - "sets = [[1,], [2], [3], [4], [5]]\n", - "for i in sets:\n", - " for j in i:\n", - " if j % 2 == 0:\n", - " print(\"Student \" + str(j))\n" + "set1 = {1, 2, 3, 4, 5}\n", + "set2 = set(set1)\n", + "set3 = set(set1)\n", + "set4 = set(set1)\n", + "set5 = set(set1) \n", + "\n", + "\n", + "for i in range(1, 6):\n", + " print(f\"Set: {i}\")\n", + " if i % 2 == 0:\n", + " for j in range(len(set1)):\n", + " print(f\"Student {j}\")\n", + " " ] }, { @@ -602,18 +623,19 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 1, "metadata": {}, "outputs": [ { - "data": { - "text/plain": [ - "4" - ] - }, - "execution_count": 45, - "metadata": {}, - "output_type": "execute_result" + "ename": "NameError", + "evalue": "name 'AD450_math' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[31m---------------------------------------------------------------------------\u001b[39m", + "\u001b[31mNameError\u001b[39m Traceback (most recent call last)", + "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[1]\u001b[39m\u001b[32m, line 2\u001b[39m\n\u001b[32m 1\u001b[39m \u001b[38;5;66;03m# Cell with import error\u001b[39;00m\n\u001b[32m----> \u001b[39m\u001b[32m2\u001b[39m \u001b[43mAD450_math\u001b[49m.multiply(\u001b[32m2\u001b[39m, \u001b[32m2\u001b[39m)\n", + "\u001b[31mNameError\u001b[39m: name 'AD450_math' is not defined" + ] } ], "source": [ @@ -623,16 +645,31 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "# Reload cell\n" + "# Reload cell\n", + "import importlib\n", + "import AD450_math\n", + "\n", + "importlib.reload(AD450_math)\n" ] }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -641,7 +678,7 @@ "4" ] }, - "execution_count": 47, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" }