From d6911aba7fcc4e0bbd79cc40b6a4fea40a7a9ca9 Mon Sep 17 00:00:00 2001 From: Melih Can Alan Date: Sat, 4 May 2024 11:36:20 -0400 Subject: [PATCH 1/2] completed the assignment-1 --- 02_assignments/assignment_1.ipynb | 90 ++++++++++++++++++++++++++----- 1 file changed, 77 insertions(+), 13 deletions(-) diff --git a/02_assignments/assignment_1.ipynb b/02_assignments/assignment_1.ipynb index 94688931..6b4d4924 100644 --- a/02_assignments/assignment_1.ipynb +++ b/02_assignments/assignment_1.ipynb @@ -26,8 +26,8 @@ " * Open a private window in your browser. Copy and paste the link to your pull request into the address bar. Make sure you can see your pull request properly. This helps the technical facilitator and learning support staff review your submission easily.\n", "\n", "Checklist:\n", - "- [ ] Created a branch with the correct naming convention.\n", - "- [ ] Ensured that the repository is public.\n", + "- [X] Created a branch with the correct naming convention.\n", + "- [X] Ensured that the repository is public.\n", "- [ ] Reviewed the PR description guidelines and adhered to them.\n", "- [ ] Verify that the link is accessible in a private browser window.\n", "\n", @@ -56,13 +56,27 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "# This is a function, which we will learn more about next week. For testing purposes, we will write our code in the function\n", "def anagram_checker(word_a, word_b):\n", " # Your code here\n", + " # use .lower() method to lowercase all characters and sort them so anagrams would become identical strings\n", + " # if modified strings are equal, they're anagram, so return true, if not return false\n", + " return sorted(word_a.lower()) == sorted(word_b.lower())\n", "\n", "# Run your code to check using the words below:\n", "anagram_checker(\"Slient\", \"listen\")" @@ -70,18 +84,40 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "anagram_checker(\"Slient\", \"Night\")" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "anagram_checker(\"night\", \"Thing\")" ] @@ -97,12 +133,29 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 15, + "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", + " # if it is case sensitive, we don't modify the string to lower or upper case we just sort and compare\n", + " return sorted(word_a) == sorted(word_b)\n", + " else:\n", + " # if it is not case sensitive, it is same as before\n", + " return sorted(word_a.lower()) == sorted(word_b.lower())\n", "\n", "# Run your code to check using the words below:\n", "anagram_checker(\"Slient\", \"listen\", False) # True" @@ -110,9 +163,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "anagram_checker(\"Slient\", \"Listen\", True) # False" ] @@ -144,7 +208,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.8" + "version": "3.9.18" } }, "nbformat": 4, From 2de49795f288e5ca4d11a544d3505cee336beda9 Mon Sep 17 00:00:00 2001 From: Melih Can Alan Date: Sat, 4 May 2024 11:37:53 -0400 Subject: [PATCH 2/2] marked checkboxes --- 02_assignments/assignment_1.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/02_assignments/assignment_1.ipynb b/02_assignments/assignment_1.ipynb index 6b4d4924..1145dc1e 100644 --- a/02_assignments/assignment_1.ipynb +++ b/02_assignments/assignment_1.ipynb @@ -28,8 +28,8 @@ "Checklist:\n", "- [X] Created a branch with the correct naming convention.\n", "- [X] Ensured that the repository is public.\n", - "- [ ] Reviewed the PR description guidelines and adhered to them.\n", - "- [ ] Verify that the link is accessible in a private browser window.\n", + "- [X] Reviewed the PR description guidelines and adhered to them.\n", + "- [X] Verify that the link is accessible in a private browser window.\n", "\n", "If you encounter any difficulties or have questions, please don't hesitate to reach out to our team via our Slack at `#cohort-3-help`. Our Technical Facilitators and Learning Support staff are here to help you navigate any challenges." ]