From 14c9e9952b1067a9bf664f4145309d2e00a44759 Mon Sep 17 00:00:00 2001 From: manntintin Date: Fri, 30 May 2025 20:01:17 -0400 Subject: [PATCH 1/2] Update assignment_1.ipynb --- 02_activities/assignments/assignment_1.ipynb | 1 + 1 file changed, 1 insertion(+) diff --git a/02_activities/assignments/assignment_1.ipynb b/02_activities/assignments/assignment_1.ipynb index e22f76294..0f23c7616 100644 --- a/02_activities/assignments/assignment_1.ipynb +++ b/02_activities/assignments/assignment_1.ipynb @@ -208,3 +208,4 @@ "nbformat": 4, "nbformat_minor": 2 } + From 85b1827045928397c1ebd15363e071d3b5ddfe10 Mon Sep 17 00:00:00 2001 From: Mandy Date: Fri, 30 May 2025 20:23:17 -0400 Subject: [PATCH 2/2] upload again --- 02_activities/assignments/assignment_1.ipynb | 93 ++++++++++++++++---- 1 file changed, 75 insertions(+), 18 deletions(-) diff --git a/02_activities/assignments/assignment_1.ipynb b/02_activities/assignments/assignment_1.ipynb index fc14eb2b8..e22f76294 100644 --- a/02_activities/assignments/assignment_1.ipynb +++ b/02_activities/assignments/assignment_1.ipynb @@ -56,32 +56,65 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 3, + "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", + " return sorted(word_a.lower()) == sorted(word_b.lower())\n", "\n", "# Run your code to check using the words below:\n", - "anagram_checker(\"Silent\", \"listen\")" + "anagram_checker(\"Silent\", \"listen\")\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "anagram_checker(\"Silent\", \"Night\")" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "anagram_checker(\"night\", \"Thing\")" ] @@ -97,24 +130,49 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "def anagram_checker(word_a, word_b, is_case_sensitive):\n", - " # Modify your existing code here\n", + " if is_case_sensitive:\n", + " return sorted(word_a) == sorted(word_b)\n", + " else:\n", + " return sorted(word_a.lower()) == sorted(word_b.lower())\n", + "\n", "\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": 4, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "anagram_checker(\"Silent\", \"Listen\", True) # False" + "anagram_checker(\"Silent\", \"Listen\", True)\n" ] }, { @@ -130,7 +188,7 @@ ], "metadata": { "kernelspec": { - "display_name": "new-learner", + "display_name": "dsi_participant", "language": "python", "name": "python3" }, @@ -144,10 +202,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.8" + "version": "3.9.7" } }, "nbformat": 4, "nbformat_minor": 2 } -