From e16652f2114d294b596db25edacc02aa3433be8f Mon Sep 17 00:00:00 2001 From: Tony V Date: Sat, 14 Nov 2026 19:23:44 -0500 Subject: [PATCH 1/3] Updated code as per requirements --- 02_activities/assignments/assignment_1.ipynb | 108 ++++++++++++++++--- 1 file changed, 92 insertions(+), 16 deletions(-) diff --git a/02_activities/assignments/assignment_1.ipynb b/02_activities/assignments/assignment_1.ipynb index 72610110d..d9d999b28 100644 --- a/02_activities/assignments/assignment_1.ipynb +++ b/02_activities/assignments/assignment_1.ipynb @@ -56,32 +56,68 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "# For testing purposes, we will write our code in the function\n", "def anagram_checker(word_a, word_b):\n", " # Your code here\n", - "\n", + " word_a = sorted(word_a.lower())\n", + " word_b = sorted(word_b.lower())\n", + " \n", + " return word_a == word_b\n", "# Run your code to check using the words below:\n", "anagram_checker(\"Silent\", \"listen\")" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "anagram_checker(\"Silent\", \"Night\")" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "anagram_checker(\"night\", \"Thing\")" ] @@ -97,31 +133,71 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "def anagram_checker(word_a, word_b, is_case_sensitive):\n", " # Modify your existing code here\n", - "\n", + " if is_case_sensitive == True:\n", + " word_a = sorted(word_a)\n", + " word_b = sorted(word_b)\n", + " else: \n", + " word_a = sorted(word_a.lower())\n", + " word_b = sorted(word_b.lower())\n", + " \n", + " return word_a == word_b\n", "# Run your code to check using the words below:\n", "anagram_checker(\"Silent\", \"listen\", False) # True" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "anagram_checker(\"Silent\", \"listen\", True) # False" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "anagram_checker(\"Silent\", \"Listen\", True) # False" ] @@ -139,7 +215,7 @@ ], "metadata": { "kernelspec": { - "display_name": "new-learner", + "display_name": "python-env (3.11.18)", "language": "python", "name": "python3" }, @@ -153,7 +229,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.8" + "version": "3.11.18" } }, "nbformat": 4, From 0770bbdf8b26d486b40f5d22797f05f96d4fbba6 Mon Sep 17 00:00:00 2001 From: Tony V Date: Sat, 14 Nov 2026 19:42:59 -0500 Subject: [PATCH 2/3] Removed Errors --- 02_activities/assignments/assignment_1.ipynb | 99 ++++---------------- 1 file changed, 18 insertions(+), 81 deletions(-) diff --git a/02_activities/assignments/assignment_1.ipynb b/02_activities/assignments/assignment_1.ipynb index d9d999b28..a650cd7ce 100644 --- a/02_activities/assignments/assignment_1.ipynb +++ b/02_activities/assignments/assignment_1.ipynb @@ -56,24 +56,15 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# For testing purposes, we will write our code in the function\n", + "# This function is defined to test whether two arguments are anagrams or not\n", "def anagram_checker(word_a, word_b):\n", " # Your code here\n", + " # creates two lists of sorted letters from word_a and word_b and converts them to lower case letters in order to test if they are equal\n", " word_a = sorted(word_a.lower())\n", " word_b = sorted(word_b.lower())\n", " \n", @@ -84,40 +75,18 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "False" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "anagram_checker(\"Silent\", \"Night\")" ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "anagram_checker(\"night\", \"Thing\")" ] @@ -133,71 +102,39 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ + "# This function is defined to test whether two arguments are anagrams or not and case_Sensitivity if specified\n", "def anagram_checker(word_a, word_b, is_case_sensitive):\n", " # Modify your existing code here\n", - " if is_case_sensitive == True:\n", + " if is_case_sensitive == True:\n", " word_a = sorted(word_a)\n", " word_b = sorted(word_b)\n", - " else: \n", + " else: \n", " word_a = sorted(word_a.lower())\n", " word_b = sorted(word_b.lower())\n", " \n", - " return word_a == word_b\n", + " return word_a == word_b\n", "# Run your code to check using the words below:\n", "anagram_checker(\"Silent\", \"listen\", False) # True" ] }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "False" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "anagram_checker(\"Silent\", \"listen\", True) # False" ] }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "False" - ] - }, - "execution_count": 12, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "anagram_checker(\"Silent\", \"Listen\", True) # False" ] From 4af2c44a6da478dd74ef173109848393001e8232 Mon Sep 17 00:00:00 2001 From: Tony V Date: Sat, 14 Nov 2026 19:49:07 -0500 Subject: [PATCH 3/3] Added new line to the code --- 02_activities/assignments/assignment_1.ipynb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/02_activities/assignments/assignment_1.ipynb b/02_activities/assignments/assignment_1.ipynb index a650cd7ce..45dac407a 100644 --- a/02_activities/assignments/assignment_1.ipynb +++ b/02_activities/assignments/assignment_1.ipynb @@ -65,6 +65,7 @@ "def anagram_checker(word_a, word_b):\n", " # Your code here\n", " # creates two lists of sorted letters from word_a and word_b and converts them to lower case letters in order to test if they are equal\n", + " \n", " word_a = sorted(word_a.lower())\n", " word_b = sorted(word_b.lower())\n", " \n", @@ -109,6 +110,7 @@ "# This function is defined to test whether two arguments are anagrams or not and case_Sensitivity if specified\n", "def anagram_checker(word_a, word_b, is_case_sensitive):\n", " # Modify your existing code here\n", + " \n", " if is_case_sensitive == True:\n", " word_a = sorted(word_a)\n", " word_b = sorted(word_b)\n",