diff --git a/04_this_cohort/live-code/03_09_2026.ipynb b/04_this_cohort/live-code/03_09_2026.ipynb index 274622872..5c4689509 100644 --- a/04_this_cohort/live-code/03_09_2026.ipynb +++ b/04_this_cohort/live-code/03_09_2026.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 4, + "execution_count": 10, "id": "c8b8023e", "metadata": {}, "outputs": [], @@ -14,7 +14,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 11, "id": "675cd834", "metadata": {}, "outputs": [ @@ -24,7 +24,7 @@ "7" ] }, - "execution_count": 5, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -35,7 +35,15 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, + "id": "1e3a885f", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 12, "id": "47ffc857", "metadata": {}, "outputs": [ @@ -45,7 +53,7 @@ "10" ] }, - "execution_count": 6, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -56,7 +64,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 13, "id": "e6b70980", "metadata": {}, "outputs": [ @@ -66,7 +74,7 @@ "False" ] }, - "execution_count": 8, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -77,7 +85,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 4, "id": "44ba56a4", "metadata": {}, "outputs": [ @@ -87,7 +95,7 @@ "'This is a string'" ] }, - "execution_count": 9, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -100,7 +108,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 5, "id": "6bead73f", "metadata": {}, "outputs": [ @@ -110,7 +118,7 @@ "'This is also a string'" ] }, - "execution_count": 10, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -121,7 +129,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 6, "id": "97c10af3", "metadata": {}, "outputs": [ @@ -130,7 +138,7 @@ "evalue": "unterminated string literal (detected at line 1) (1531528915.py, line 1)", "output_type": "error", "traceback": [ - " \u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[11]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[31m \u001b[39m\u001b[31m'This is not a valid string\"\u001b[39m\n ^\n\u001b[31mSyntaxError\u001b[39m\u001b[31m:\u001b[39m unterminated string literal (detected at line 1)\n" + " \u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[6]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[31m \u001b[39m\u001b[31m'This is not a valid string\"\u001b[39m\n ^\n\u001b[31mSyntaxError\u001b[39m\u001b[31m:\u001b[39m unterminated string literal (detected at line 1)\n" ] } ], @@ -140,7 +148,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 7, "id": "159d9cd7", "metadata": {}, "outputs": [ @@ -149,7 +157,7 @@ "evalue": "unterminated string literal (detected at line 1) (3205553238.py, line 1)", "output_type": "error", "traceback": [ - " \u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[12]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[31m \u001b[39m\u001b[31m'Let's see if this works'\u001b[39m\n ^\n\u001b[31mSyntaxError\u001b[39m\u001b[31m:\u001b[39m unterminated string literal (detected at line 1)\n" + " \u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[7]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[31m \u001b[39m\u001b[31m'Let's see if this works'\u001b[39m\n ^\n\u001b[31mSyntaxError\u001b[39m\u001b[31m:\u001b[39m unterminated string literal (detected at line 1)\n" ] } ], @@ -159,7 +167,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 8, "id": "f5f4aeab", "metadata": {}, "outputs": [ @@ -169,7 +177,7 @@ "\"Let's see if this works\"" ] }, - "execution_count": 13, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -180,7 +188,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 9, "id": "e417b52d", "metadata": {}, "outputs": [ @@ -190,7 +198,7 @@ "'This \\nis \\na \\nmultiline \\nstring'" ] }, - "execution_count": 14, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -222,7 +230,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "id": "116e75ae", "metadata": {}, "outputs": [ @@ -243,7 +251,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": null, "id": "0c074bc6", "metadata": {}, "outputs": [ @@ -261,7 +269,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": null, "id": "05670447", "metadata": {}, "outputs": [ @@ -299,7 +307,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": null, "id": "b8097580", "metadata": {}, "outputs": [ @@ -317,7 +325,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": null, "id": "e6eab22a", "metadata": {}, "outputs": [ @@ -356,7 +364,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": null, "id": "fb4f3671", "metadata": {}, "outputs": [ @@ -377,7 +385,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": null, "id": "1758efd6", "metadata": {}, "outputs": [ @@ -398,7 +406,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": null, "id": "6732f945", "metadata": {}, "outputs": [ @@ -419,7 +427,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": null, "id": "8a32488d", "metadata": {}, "outputs": [ @@ -441,7 +449,7 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": null, "id": "c55d8678", "metadata": {}, "outputs": [ @@ -462,7 +470,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": null, "id": "023692c9", "metadata": {}, "outputs": [ @@ -483,7 +491,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": null, "id": "41459c7f", "metadata": {}, "outputs": [ @@ -504,7 +512,7 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": null, "id": "aa0da1ed", "metadata": {}, "outputs": [ @@ -532,7 +540,7 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": null, "id": "8d165181", "metadata": {}, "outputs": [], @@ -543,7 +551,7 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": null, "id": "fd41b5b8", "metadata": {}, "outputs": [ @@ -564,7 +572,7 @@ }, { "cell_type": "code", - "execution_count": 51, + "execution_count": null, "id": "4678f4f4", "metadata": {}, "outputs": [ @@ -585,7 +593,7 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": null, "id": "6c1a1636", "metadata": {}, "outputs": [ @@ -606,7 +614,7 @@ }, { "cell_type": "code", - "execution_count": 55, + "execution_count": null, "id": "7fc45fcb", "metadata": {}, "outputs": [ @@ -627,7 +635,7 @@ }, { "cell_type": "code", - "execution_count": 56, + "execution_count": null, "id": "d9d5a6b1", "metadata": {}, "outputs": [ @@ -648,7 +656,7 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": null, "id": "7ffd54bd", "metadata": {}, "outputs": [ @@ -669,7 +677,7 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": null, "id": "906af842", "metadata": {}, "outputs": [ @@ -690,7 +698,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": null, "id": "c9da91b1", "metadata": {}, "outputs": [ @@ -711,7 +719,7 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": null, "id": "8eea8427", "metadata": {}, "outputs": [ @@ -755,7 +763,7 @@ }, { "cell_type": "code", - "execution_count": 63, + "execution_count": null, "id": "e6c86848", "metadata": {}, "outputs": [], @@ -765,7 +773,7 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": null, "id": "c2bcfee9", "metadata": {}, "outputs": [ @@ -786,7 +794,7 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": null, "id": "ec771fa3", "metadata": {}, "outputs": [ @@ -807,7 +815,7 @@ }, { "cell_type": "code", - "execution_count": 67, + "execution_count": null, "id": "4fa3e573", "metadata": {}, "outputs": [ @@ -825,7 +833,7 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": null, "id": "349bbbee", "metadata": {}, "outputs": [ @@ -846,7 +854,7 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": null, "id": "be48c4f2", "metadata": {}, "outputs": [ @@ -868,7 +876,7 @@ }, { "cell_type": "code", - "execution_count": 70, + "execution_count": null, "id": "900819bd", "metadata": {}, "outputs": [ @@ -889,7 +897,7 @@ }, { "cell_type": "code", - "execution_count": 71, + "execution_count": null, "id": "21a42dd9", "metadata": {}, "outputs": [ @@ -915,7 +923,7 @@ }, { "cell_type": "code", - "execution_count": 74, + "execution_count": null, "id": "41384639", "metadata": {}, "outputs": [ @@ -936,7 +944,7 @@ }, { "cell_type": "code", - "execution_count": 75, + "execution_count": null, "id": "ccc08fac", "metadata": {}, "outputs": [ @@ -957,7 +965,7 @@ }, { "cell_type": "code", - "execution_count": 76, + "execution_count": null, "id": "73faafc0", "metadata": {}, "outputs": [ @@ -978,7 +986,7 @@ }, { "cell_type": "code", - "execution_count": 77, + "execution_count": null, "id": "0283c389", "metadata": {}, "outputs": [ @@ -999,7 +1007,7 @@ }, { "cell_type": "code", - "execution_count": 78, + "execution_count": null, "id": "e3dd2b2b", "metadata": {}, "outputs": [ @@ -1020,7 +1028,7 @@ }, { "cell_type": "code", - "execution_count": 80, + "execution_count": null, "id": "575f8468", "metadata": {}, "outputs": [ @@ -1041,7 +1049,7 @@ }, { "cell_type": "code", - "execution_count": 81, + "execution_count": null, "id": "ba4d5331", "metadata": {}, "outputs": [ @@ -1062,7 +1070,7 @@ }, { "cell_type": "code", - "execution_count": 79, + "execution_count": null, "id": "7af266c4", "metadata": {}, "outputs": [ @@ -1085,7 +1093,7 @@ }, { "cell_type": "code", - "execution_count": 83, + "execution_count": null, "id": "01afdb05", "metadata": {}, "outputs": [ @@ -1106,7 +1114,7 @@ }, { "cell_type": "code", - "execution_count": 84, + "execution_count": null, "id": "feb83384", "metadata": {}, "outputs": [ @@ -1129,7 +1137,7 @@ }, { "cell_type": "code", - "execution_count": 86, + "execution_count": null, "id": "20c3c660", "metadata": {}, "outputs": [ @@ -1150,7 +1158,7 @@ }, { "cell_type": "code", - "execution_count": 87, + "execution_count": null, "id": "dbafa96e", "metadata": {}, "outputs": [ @@ -1175,7 +1183,7 @@ }, { "cell_type": "code", - "execution_count": 88, + "execution_count": null, "id": "5150b562", "metadata": {}, "outputs": [ @@ -1197,7 +1205,7 @@ }, { "cell_type": "code", - "execution_count": 89, + "execution_count": null, "id": "33ed9c2e", "metadata": {}, "outputs": [ @@ -1240,7 +1248,7 @@ }, { "cell_type": "code", - "execution_count": 91, + "execution_count": null, "id": "a93cfd8a", "metadata": {}, "outputs": [ @@ -1261,7 +1269,7 @@ }, { "cell_type": "code", - "execution_count": 97, + "execution_count": null, "id": "6c8b0eca", "metadata": {}, "outputs": [ @@ -1283,7 +1291,7 @@ }, { "cell_type": "code", - "execution_count": 98, + "execution_count": null, "id": "3cbbfb73", "metadata": {}, "outputs": [ @@ -1305,7 +1313,7 @@ }, { "cell_type": "code", - "execution_count": 99, + "execution_count": null, "id": "112ecc3f", "metadata": {}, "outputs": [ @@ -1327,7 +1335,7 @@ }, { "cell_type": "code", - "execution_count": 100, + "execution_count": null, "id": "90467956", "metadata": {}, "outputs": [ @@ -1350,7 +1358,7 @@ }, { "cell_type": "code", - "execution_count": 101, + "execution_count": null, "id": "bb8cf634", "metadata": {}, "outputs": [ @@ -1372,7 +1380,7 @@ }, { "cell_type": "code", - "execution_count": 102, + "execution_count": null, "id": "1b287393", "metadata": {}, "outputs": [ @@ -1395,7 +1403,7 @@ }, { "cell_type": "code", - "execution_count": 104, + "execution_count": null, "id": "7e6bc672", "metadata": {}, "outputs": [ @@ -1418,7 +1426,7 @@ }, { "cell_type": "code", - "execution_count": 105, + "execution_count": null, "id": "ebad40aa", "metadata": {}, "outputs": [], @@ -1428,7 +1436,7 @@ }, { "cell_type": "code", - "execution_count": 106, + "execution_count": null, "id": "65e11c3f", "metadata": {}, "outputs": [ @@ -1449,7 +1457,7 @@ }, { "cell_type": "code", - "execution_count": 107, + "execution_count": null, "id": "12420d82", "metadata": {}, "outputs": [], @@ -1459,7 +1467,7 @@ }, { "cell_type": "code", - "execution_count": 108, + "execution_count": null, "id": "880cc30a", "metadata": {}, "outputs": [ @@ -1480,7 +1488,7 @@ }, { "cell_type": "code", - "execution_count": 116, + "execution_count": null, "id": "53404147", "metadata": {}, "outputs": [], @@ -1490,7 +1498,7 @@ }, { "cell_type": "code", - "execution_count": 110, + "execution_count": null, "id": "80f35c09", "metadata": {}, "outputs": [ @@ -1511,7 +1519,7 @@ }, { "cell_type": "code", - "execution_count": 113, + "execution_count": null, "id": "8d1c9bdc", "metadata": {}, "outputs": [ @@ -1590,7 +1598,7 @@ }, { "cell_type": "code", - "execution_count": 123, + "execution_count": null, "id": "5721d429", "metadata": {}, "outputs": [ @@ -1614,7 +1622,7 @@ }, { "cell_type": "code", - "execution_count": 124, + "execution_count": null, "id": "34cd8c44", "metadata": {}, "outputs": [ @@ -1635,7 +1643,7 @@ }, { "cell_type": "code", - "execution_count": 117, + "execution_count": null, "id": "5c4e350e", "metadata": {}, "outputs": [ @@ -1715,7 +1723,7 @@ }, { "cell_type": "code", - "execution_count": 130, + "execution_count": null, "id": "59eda2f3", "metadata": {}, "outputs": [ @@ -1738,7 +1746,7 @@ }, { "cell_type": "code", - "execution_count": 131, + "execution_count": null, "id": "0196893a", "metadata": {}, "outputs": [ @@ -1759,7 +1767,7 @@ }, { "cell_type": "code", - "execution_count": 132, + "execution_count": null, "id": "99b4d635", "metadata": {}, "outputs": [ @@ -1801,7 +1809,7 @@ }, { "cell_type": "code", - "execution_count": 136, + "execution_count": null, "id": "76cb9b54", "metadata": {}, "outputs": [ @@ -1822,7 +1830,7 @@ }, { "cell_type": "code", - "execution_count": 137, + "execution_count": null, "id": "3439af4d", "metadata": {}, "outputs": [ @@ -1843,7 +1851,7 @@ }, { "cell_type": "code", - "execution_count": 135, + "execution_count": null, "id": "30d638db", "metadata": {}, "outputs": [ @@ -1921,7 +1929,7 @@ }, { "cell_type": "code", - "execution_count": 140, + "execution_count": null, "id": "3002f55b", "metadata": {}, "outputs": [ @@ -1942,7 +1950,7 @@ }, { "cell_type": "code", - "execution_count": 141, + "execution_count": null, "id": "f09120a4", "metadata": {}, "outputs": [ @@ -2009,7 +2017,7 @@ }, { "cell_type": "code", - "execution_count": 145, + "execution_count": null, "id": "29d6e9e1", "metadata": {}, "outputs": [ @@ -2074,7 +2082,7 @@ }, { "cell_type": "code", - "execution_count": 152, + "execution_count": null, "id": "f68ce0da", "metadata": {}, "outputs": [ @@ -2098,7 +2106,7 @@ }, { "cell_type": "code", - "execution_count": 153, + "execution_count": null, "id": "140fd7e0", "metadata": {}, "outputs": [ @@ -2119,7 +2127,7 @@ }, { "cell_type": "code", - "execution_count": 154, + "execution_count": null, "id": "3ee1b166", "metadata": {}, "outputs": [ @@ -2140,7 +2148,7 @@ }, { "cell_type": "code", - "execution_count": 155, + "execution_count": null, "id": "fb97159e", "metadata": {}, "outputs": [ @@ -2321,7 +2329,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.13" + "version": "3.11.15" } }, "nbformat": 4, diff --git a/python-env/Assignment_1_AJNC.ipynb b/python-env/Assignment_1_AJNC.ipynb new file mode 100644 index 000000000..2ee0e75c4 --- /dev/null +++ b/python-env/Assignment_1_AJNC.ipynb @@ -0,0 +1,203 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "2150f740", + "metadata": {}, + "source": [ + "Part 1: Building the base Anagram Checker" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "d03114a0", + "metadata": {}, + "outputs": [], + "source": [ + "# For testing purposes, we will write our code in the function\n", + "def anagram_checker(word_a, word_b):\n", + " if sorted(word_a.lower()) == sorted(word_b.lower()): #I made the words lowercase and ordered them alphabetically to see if they match\n", + " return True\n", + " else:\n", + " return False" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "9fb548cc", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "anagram_checker(\"Silent\", \"listen\")" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "id": "65bb341a", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "anagram_checker(\"Silent\", \"Night\")" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "6ab49975", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "\n", + "anagram_checker(\"night\", \"Thing\")" + ] + }, + { + "cell_type": "markdown", + "id": "46743fd0", + "metadata": {}, + "source": [ + "Part 2: Expanding the functionality of the Anagram Checker\n" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "id": "d754360e", + "metadata": {}, + "outputs": [], + "source": [ + "\n", + "def anagram_checker_S(word_a, word_b, is_case_sensitive):\n", + " if not is_case_sensitive: #if is sensitive is false, it is converted to lowercase \n", + " word_a = word_a.lower()\n", + " word_b = word_b.lower()\n", + "\n", + " if sorted(word_a) == sorted(word_b): #ordered them alphabetically\n", + " return True\n", + " else:\n", + " return False " + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "4e539e5d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "anagram_checker_S(\"Silent\", \"listen\", False)" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "id": "f914b000", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "anagram_checker_S(\"Silent\", \"listen\", True) " + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "id": "d86c0703", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "\n", + "anagram_checker_S(\"Silent\", \"Listen\", True)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.9" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}