From 14ac1ea1fafcd92d0ddecb971ac259d406688dc4 Mon Sep 17 00:00:00 2001 From: Dellannia Segreti Date: Mon, 16 Mar 2026 18:05:14 -0400 Subject: [PATCH 1/4] this was my frst try --- 02_activities/assignments/assignment_1.ipynb | 49 +++++++++++++++++--- 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/02_activities/assignments/assignment_1.ipynb b/02_activities/assignments/assignment_1.ipynb index 2dca19d0b..a098611f6 100644 --- a/02_activities/assignments/assignment_1.ipynb +++ b/02_activities/assignments/assignment_1.ipynb @@ -56,13 +56,37 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "AttributeError", + "evalue": "'str' object has no attribute 'symmetric_difference'", + "output_type": "error", + "traceback": [ + "\u001b[31m---------------------------------------------------------------------------\u001b[39m", + "\u001b[31mAttributeError\u001b[39m Traceback (most recent call last)", + "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[3]\u001b[39m\u001b[32m, line 17\u001b[39m\n\u001b[32m 12\u001b[39m \u001b[38;5;28mprint\u001b[39m(\u001b[33m'\u001b[39m\u001b[33mFalse\u001b[39m\u001b[33m'\u001b[39m)\n\u001b[32m 16\u001b[39m \u001b[38;5;66;03m# Run your code to check using the words below:\u001b[39;00m\n\u001b[32m---> \u001b[39m\u001b[32m17\u001b[39m \u001b[43managram_checker\u001b[49m\u001b[43m(\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mSilent\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mlisten\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n", + "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[3]\u001b[39m\u001b[32m, line 7\u001b[39m, in \u001b[36managram_checker\u001b[39m\u001b[34m(word_a, word_b)\u001b[39m\n\u001b[32m 5\u001b[39m {word_b}\n\u001b[32m 6\u001b[39m \u001b[38;5;66;03m# we want to then see all values only in one of two sets\u001b[39;00m\n\u001b[32m----> \u001b[39m\u001b[32m7\u001b[39m \u001b[43mword_a\u001b[49m\u001b[43m.\u001b[49m\u001b[43msymmetric_difference\u001b[49m(word_b)\n\u001b[32m 8\u001b[39m \u001b[38;5;66;03m# if symmatric_difference is True then we want to print True and if False then we print False \u001b[39;00m\n\u001b[32m 9\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m word_a.symmetric_difference(word_b) == \u001b[38;5;28mset\u001b[39m(): \n", + "\u001b[31mAttributeError\u001b[39m: 'str' object has no attribute 'symmetric_difference'" + ] + } + ], "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", + " # first we need to make into a set \n", + " {word_a}\n", + " {word_b}\n", + " # we want to then see all values only in one of two sets\n", + " word_a.symmetric_difference(word_b)\n", + " # if symmatric_difference is True then we want to print True and if False then we print False \n", + " if word_a.symmetric_difference(word_b) == set(): \n", + " print('True')\n", + " if word_a.symmetric_difference(word_b) != set(): \n", + " print('False')\n", + "\n", + "\n", "\n", "# Run your code to check using the words below:\n", "anagram_checker(\"Silent\", \"listen\")" @@ -102,7 +126,20 @@ "outputs": [], "source": [ "def anagram_checker(word_a, word_b, is_case_sensitive):\n", - " # Modify your existing code here\n", + " # first we need to make into a set \n", + " {word_a}\n", + " {word_b}\n", + " # we want to then see all values only in one of two sets \n", + " word_a.symmetric_difference(word_b)\n", + " # if symmetric_difference is True then we want to print True and if False then we print False \n", + " if word_a.symmetric_difference(word_b) == set(): \n", + " print('True')\n", + " if word_a.symmetric_difference(word_b) != set(): \n", + " print('False')\n", + " if not is_case_sensitive: \n", + " print('True')\n", + " if is_case_sensitive:\n", + " print('False')\n", "\n", "# Run your code to check using the words below:\n", "anagram_checker(\"Silent\", \"listen\", False) # True" @@ -139,7 +176,7 @@ ], "metadata": { "kernelspec": { - "display_name": "new-learner", + "display_name": "python-env (3.11.14)", "language": "python", "name": "python3" }, @@ -153,7 +190,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.8" + "version": "3.11.14" } }, "nbformat": 4, From e6c0ba5f914a750ecc7aa06c9f13e1b678ed9f0a Mon Sep 17 00:00:00 2001 From: Dellannia Segreti Date: Wed, 18 Mar 2026 15:58:04 -0400 Subject: [PATCH 2/4] try 2 --- 02_activities/assignments/assignment_1.ipynb | 94 +++++++++++--------- 1 file changed, 53 insertions(+), 41 deletions(-) diff --git a/02_activities/assignments/assignment_1.ipynb b/02_activities/assignments/assignment_1.ipynb index a098611f6..1edc5a2cd 100644 --- a/02_activities/assignments/assignment_1.ipynb +++ b/02_activities/assignments/assignment_1.ipynb @@ -56,35 +56,25 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 12, "metadata": {}, - "outputs": [ - { - "ename": "AttributeError", - "evalue": "'str' object has no attribute 'symmetric_difference'", - "output_type": "error", - "traceback": [ - "\u001b[31m---------------------------------------------------------------------------\u001b[39m", - "\u001b[31mAttributeError\u001b[39m Traceback (most recent call last)", - "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[3]\u001b[39m\u001b[32m, line 17\u001b[39m\n\u001b[32m 12\u001b[39m \u001b[38;5;28mprint\u001b[39m(\u001b[33m'\u001b[39m\u001b[33mFalse\u001b[39m\u001b[33m'\u001b[39m)\n\u001b[32m 16\u001b[39m \u001b[38;5;66;03m# Run your code to check using the words below:\u001b[39;00m\n\u001b[32m---> \u001b[39m\u001b[32m17\u001b[39m \u001b[43managram_checker\u001b[49m\u001b[43m(\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mSilent\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mlisten\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n", - "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[3]\u001b[39m\u001b[32m, line 7\u001b[39m, in \u001b[36managram_checker\u001b[39m\u001b[34m(word_a, word_b)\u001b[39m\n\u001b[32m 5\u001b[39m {word_b}\n\u001b[32m 6\u001b[39m \u001b[38;5;66;03m# we want to then see all values only in one of two sets\u001b[39;00m\n\u001b[32m----> \u001b[39m\u001b[32m7\u001b[39m \u001b[43mword_a\u001b[49m\u001b[43m.\u001b[49m\u001b[43msymmetric_difference\u001b[49m(word_b)\n\u001b[32m 8\u001b[39m \u001b[38;5;66;03m# if symmatric_difference is True then we want to print True and if False then we print False \u001b[39;00m\n\u001b[32m 9\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m word_a.symmetric_difference(word_b) == \u001b[38;5;28mset\u001b[39m(): \n", - "\u001b[31mAttributeError\u001b[39m: 'str' object has no attribute 'symmetric_difference'" - ] - } - ], + "outputs": [], "source": [ "# For testing purposes, we will write our code in the function\n", "def anagram_checker(word_a, word_b):\n", - " # first we need to make into a set \n", - " {word_a}\n", - " {word_b}\n", - " # we want to then see all values only in one of two sets\n", - " word_a.symmetric_difference(word_b)\n", - " # if symmatric_difference is True then we want to print True and if False then we print False \n", - " if word_a.symmetric_difference(word_b) == set(): \n", - " print('True')\n", - " if word_a.symmetric_difference(word_b) != set(): \n", - " print('False')\n", + " # first we need to make into a set for the whole words\n", + " set(word_a)\n", + " set(word_b)\n", + " \n", + " # we want to ensure the lengths of the words are included \n", + " len(word_a) == len(word_b)\n", + "\n", + " #we then want to compare the sorted letters in alpha order and have then be equal\n", + " sorted(word_a) == sorted(word_b)\n", + "\n", + " #we then need to use the and operator so that 'True' or 'False' is produced \n", + " (sorted(word_a) == sorted(word_b)) and (len(word_a) == len(word_b))\n", + " \n", "\n", "\n", "\n", @@ -97,13 +87,20 @@ "execution_count": null, "metadata": {}, "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [], "source": [ "anagram_checker(\"Silent\", \"Night\")" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ @@ -123,23 +120,38 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "AttributeError", + "evalue": "'str' object has no attribute 'symmetric_difference'", + "output_type": "error", + "traceback": [ + "\u001b[31m---------------------------------------------------------------------------\u001b[39m", + "\u001b[31mAttributeError\u001b[39m Traceback (most recent call last)", + "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[7]\u001b[39m\u001b[32m, line 19\u001b[39m\n\u001b[32m 16\u001b[39m \u001b[38;5;28mprint\u001b[39m(\u001b[33m'\u001b[39m\u001b[33mFalse\u001b[39m\u001b[33m'\u001b[39m)\n\u001b[32m 18\u001b[39m \u001b[38;5;66;03m# Run your code to check using the words below:\u001b[39;00m\n\u001b[32m---> \u001b[39m\u001b[32m19\u001b[39m \u001b[43managram_checker\u001b[49m\u001b[43m(\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mSilent\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mlisten\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m)\u001b[49m \u001b[38;5;66;03m# True\u001b[39;00m\n", + "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[7]\u001b[39m\u001b[32m, line 7\u001b[39m, in \u001b[36managram_checker\u001b[39m\u001b[34m(word_a, word_b, is_case_sensitive)\u001b[39m\n\u001b[32m 4\u001b[39m \u001b[38;5;28mset\u001b[39m(word_b)\n\u001b[32m 6\u001b[39m \u001b[38;5;66;03m# we want to then see all values only in one of two sets \u001b[39;00m\n\u001b[32m----> \u001b[39m\u001b[32m7\u001b[39m \u001b[43mword_a\u001b[49m\u001b[43m.\u001b[49m\u001b[43msymmetric_difference\u001b[49m(word_b)\n\u001b[32m 8\u001b[39m \u001b[38;5;66;03m# if symmetric_difference is True then we want to print True and if False then we print False \u001b[39;00m\n\u001b[32m 9\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m word_a.symmetric_difference(word_b) == \u001b[38;5;28mset\u001b[39m(): \n", + "\u001b[31mAttributeError\u001b[39m: 'str' object has no attribute 'symmetric_difference'" + ] + } + ], "source": [ "def anagram_checker(word_a, word_b, is_case_sensitive):\n", - " # first we need to make into a set \n", - " {word_a}\n", - " {word_b}\n", - " # we want to then see all values only in one of two sets \n", - " word_a.symmetric_difference(word_b)\n", - " # if symmetric_difference is True then we want to print True and if False then we print False \n", - " if word_a.symmetric_difference(word_b) == set(): \n", - " print('True')\n", - " if word_a.symmetric_difference(word_b) != set(): \n", - " print('False')\n", - " if not is_case_sensitive: \n", - " print('True')\n", - " if is_case_sensitive:\n", - " print('False')\n", + " # first we need to make into a set for the whole words\n", + " set(word_a)\n", + " set(word_b)\n", + " \n", + " # we want to ensure the lengths of the words are included \n", + " len(word_a) == len(word_b)\n", + "\n", + " #we then want to compare the sorted letters in alpha order and have then be equal\n", + " sorted(word_a) == sorted(word_b)\n", + "\n", + " #consider if it is_case_sensitive\n", + " def is_case_sensitive:\n", + " lower (word_a, word_b)\n", + "\n", + " #we then need to use the and operator so that 'True' or 'False' is produced \n", + " (sorted(word_a) == sorted(word_b)) and (len(word_a) == len(word_b))\n", "\n", "# Run your code to check using the words below:\n", "anagram_checker(\"Silent\", \"listen\", False) # True" From 602a0d17b38208fa63f941489be6e36d30da0378 Mon Sep 17 00:00:00 2001 From: Dellannia Segreti Date: Thu, 19 Mar 2026 20:59:45 -0400 Subject: [PATCH 3/4] great --- 02_activities/assignments/assignment_1.ipynb | 21 +++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/02_activities/assignments/assignment_1.ipynb b/02_activities/assignments/assignment_1.ipynb index 1edc5a2cd..968cad2bd 100644 --- a/02_activities/assignments/assignment_1.ipynb +++ b/02_activities/assignments/assignment_1.ipynb @@ -56,7 +56,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -68,13 +68,18 @@ " \n", " # we want to ensure the lengths of the words are included \n", " len(word_a) == len(word_b)\n", + " \n", + " \n", "\n", " #we then want to compare the sorted letters in alpha order and have then be equal\n", " sorted(word_a) == sorted(word_b)\n", + " \n", + "\n", + "\n", + " #we need to return to then need to use the and operator so that 'True' or 'False' is produced \n", + " return (True, False) if (sorted(word_a) == sorted(word_b)) and (len(word_a) == len(word_b))\n", + "\n", "\n", - " #we then need to use the and operator so that 'True' or 'False' is produced \n", - " (sorted(word_a) == sorted(word_b)) and (len(word_a) == len(word_b))\n", - " \n", "\n", "\n", "\n", @@ -82,13 +87,6 @@ "anagram_checker(\"Silent\", \"listen\")" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, { "cell_type": "code", "execution_count": 13, @@ -147,7 +145,6 @@ " sorted(word_a) == sorted(word_b)\n", "\n", " #consider if it is_case_sensitive\n", - " def is_case_sensitive:\n", " lower (word_a, word_b)\n", "\n", " #we then need to use the and operator so that 'True' or 'False' is produced \n", From 0e6491df777c5145e1250a6dc2833b0491e3401b Mon Sep 17 00:00:00 2001 From: Dellannia Segreti Date: Sat, 21 Mar 2026 10:25:48 -0400 Subject: [PATCH 4/4] done3 --- 02_activities/assignments/assignment_1.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/02_activities/assignments/assignment_1.ipynb b/02_activities/assignments/assignment_1.ipynb index 968cad2bd..4fe519f64 100644 --- a/02_activities/assignments/assignment_1.ipynb +++ b/02_activities/assignments/assignment_1.ipynb @@ -144,7 +144,7 @@ " #we then want to compare the sorted letters in alpha order and have then be equal\n", " sorted(word_a) == sorted(word_b)\n", "\n", - " #consider if it is_case_sensitive\n", + " #consider if it is_case_sensitive by making all the letters lowercase \n", " lower (word_a, word_b)\n", "\n", " #we then need to use the and operator so that 'True' or 'False' is produced \n",