From 2b36ab5dbe19a7a61d82ae03efda63a4d5332a37 Mon Sep 17 00:00:00 2001 From: Parnia Date: Tue, 18 Feb 2025 15:51:01 -0500 Subject: [PATCH 1/8] Delete 02_activities/assignments/assignment_1.ipynb --- 02_activities/assignments/assignment_1.ipynb | 152 ------------------- 1 file changed, 152 deletions(-) delete mode 100644 02_activities/assignments/assignment_1.ipynb diff --git a/02_activities/assignments/assignment_1.ipynb b/02_activities/assignments/assignment_1.ipynb deleted file mode 100644 index 06e695374..000000000 --- a/02_activities/assignments/assignment_1.ipynb +++ /dev/null @@ -1,152 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Assignment #1: Anagram Checker\n", - "\n", - "**Background**: Anagram Checker is a program that takes two words and determines if an anagram can be made from it. If so, the program will return `true`, otherwise `false`." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Submission Information\n", - "\n", - "🚨 **Please review our [Assignment Submission Guide](https://github.com/UofT-DSI/onboarding/blob/main/onboarding_documents/submissions.md)** 🚨 for detailed instructions on how to format, branch, and submit your work. Following these guidelines is crucial for your submissions to be evaluated correctly.\n", - "\n", - "### Submission Parameters:\n", - "* Submission Due Date: `11:59 PM - Feb 16, 2025`\n", - "* The branch name for your repo should be: `assignment-1`\n", - "* What to submit for this assignment:\n", - " * This Jupyter Notebook (assignment_1.ipynb) should be populated and should be the only change in your pull request.\n", - "* What the pull request link should look like for this assignment: `https://github.com//python/pull/`\n", - " * 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", - "- [ ] Reviewed the PR description guidelines and adhered to them.\n", - "- [ ] 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 `#dc-help`. Our Technical Facilitators and Learning Support staff are here to help you navigate any challenges." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Part 1: Building the base Anagram Checker\n", - "\n", - "Given two valid strings, check to see if they are anagrams of each other. If it is, return `True`, else `False`. For this part, we can assume that uppercase letters are the same as if it was a lowercase character.\n", - "\n", - "Examples of anagrams:\n", - "* Silent and Listen\n", - "* Night and Think\n", - "\n", - "Example outputs:\n", - "```python\n", - "anagram_checker(\"Silent\", \"listen\") # True\n", - "anagram_checker(\"Silent\", \"Night\") # False\n", - "anagram_checker(\"night\", \"Thing\") # True\n", - "```" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "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", - "# Run your code to check using the words below:\n", - "anagram_checker(\"Silent\", \"listen\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "anagram_checker(\"Silent\", \"Night\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "anagram_checker(\"night\", \"Thing\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Part 2: Expanding the functionality of the Anagram Checker\n", - "\n", - "Using your existing and functional anagram checker, let's add a boolean option called `is_case_sensitive`, which will return `True` or `False` based on if the two compared words are anagrams and if we are checking for case sensitivity." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "def anagram_checker(word_a, word_b, is_case_sensitive):\n", - " # Modify your existing code here\n", - "\n", - "# Run your code to check using the words below:\n", - "anagram_checker(\"Silent\", \"listen\", False) # True" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "anagram_checker(\"Silent\", \"Listen\", True) # False" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "|Criteria|Pass|Fail|\n", - "|---|---|---|\n", - "|Code Execution|All code cells execute without errors.|Any code cell produces an error upon execution.|\n", - "|Code Quality|Code is well-organized, concise, and includes necessary comments for clarity. E.g. Great use of variable names.|Code is unorganized, verbose, or lacks necessary comments. E.g. Single character variable names outside of loops.|" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "new-learner", - "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.8" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 7afa44e6fa85424055b515b2bab62ac7d882c0ba Mon Sep 17 00:00:00 2001 From: Parnia Date: Tue, 18 Feb 2025 15:51:21 -0500 Subject: [PATCH 2/8] Add files via upload --- 02_activities/assignments/assignment_1.ipynb | 173 +++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 02_activities/assignments/assignment_1.ipynb diff --git a/02_activities/assignments/assignment_1.ipynb b/02_activities/assignments/assignment_1.ipynb new file mode 100644 index 000000000..82df84ab2 --- /dev/null +++ b/02_activities/assignments/assignment_1.ipynb @@ -0,0 +1,173 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Assignment #1: Anagram Checker\n", + "\n", + "**Background**: Anagram Checker is a program that takes two words and determines if an anagram can be made from it. If so, the program will return `true`, otherwise `false`." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Submission Information\n", + "\n", + "🚨 **Please review our [Assignment Submission Guide](https://github.com/UofT-DSI/onboarding/blob/main/onboarding_documents/submissions.md)** 🚨 for detailed instructions on how to format, branch, and submit your work. Following these guidelines is crucial for your submissions to be evaluated correctly.\n", + "\n", + "### Submission Parameters:\n", + "* Submission Due Date: `11:59 PM - Feb 16, 2025`\n", + "* The branch name for your repo should be: `assignment-1`\n", + "* What to submit for this assignment:\n", + " * This Jupyter Notebook (assignment_1.ipynb) should be populated and should be the only change in your pull request.\n", + "* What the pull request link should look like for this assignment: `https://github.com//python/pull/`\n", + " * 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", + "- [ ] Reviewed the PR description guidelines and adhered to them.\n", + "- [ ] 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 `#dc-help`. Our Technical Facilitators and Learning Support staff are here to help you navigate any challenges." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Part 1: Building the base Anagram Checker\n", + "\n", + "Given two valid strings, check to see if they are anagrams of each other. If it is, return `True`, else `False`. For this part, we can assume that uppercase letters are the same as if it was a lowercase character.\n", + "\n", + "Examples of anagrams:\n", + "* Silent and Listen\n", + "* Night and Think\n", + "\n", + "Example outputs:\n", + "```python\n", + "anagram_checker(\"Silent\", \"listen\") # True\n", + "anagram_checker(\"Silent\", \"Night\") # False\n", + "anagram_checker(\"night\", \"Thing\") # True\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# For testing purposes, we will write our code in the function\n", + "def anagram_checker(word_a, word_b):\n", + " result=True\n", + " word_a=word_a.lower()\n", + " for letter in word_a:\n", + " if letter in word_b:\n", + " result==True \n", + " else:\n", + " result==False \n", + " return result\n", + "\n", + "# Run your code to check using the words below:\n", + "anagram_checker(\"Silent\", \"listen\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "anagram_checker(\"Silent\", \"Night\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "anagram_checker(\"night\", \"Thing\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Part 2: Expanding the functionality of the Anagram Checker\n", + "\n", + "Using your existing and functional anagram checker, let's add a boolean option called `is_case_sensitive`, which will return `True` or `False` based on if the two compared words are anagrams and if we are checking for case sensitivity." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "def anagram_checker(word_a, word_b, is_case_sensitive):\n", + "\n", + " result=True\n", + " if is_case_sensitive==True:\n", + " for letter in word_a:\n", + " if letter in word_b:\n", + " result=True \n", + " result=False \n", + " elif is_case_sensitive==False:\n", + " word_a=word_a.lower()\n", + " word_b=word_b.lower()\n", + " for letter in word_a:\n", + " if letter in word_b:\n", + " result=True \n", + " result=False \n", + " return result \n", + "\n", + "# Run your code to check using the words below:\n", + "anagram_checker(\"Silent\", \"listen\", False) # True" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "anagram_checker(\"Silent\", \"Listen\", True) # False" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "|Criteria|Pass|Fail|\n", + "|---|---|---|\n", + "|Code Execution|All code cells execute without errors.|Any code cell produces an error upon execution.|\n", + "|Code Quality|Code is well-organized, concise, and includes necessary comments for clarity. E.g. Great use of variable names.|Code is unorganized, verbose, or lacks necessary comments. E.g. Single character variable names outside of loops.|" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "new-learner", + "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.8" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 57bb581be061aa82853ad43bb09e87852ba19a4f Mon Sep 17 00:00:00 2001 From: Parnia Date: Thu, 20 Feb 2025 15:30:15 -0500 Subject: [PATCH 3/8] Delete 02_activities/assignments/assignment_1.ipynb --- 02_activities/assignments/assignment_1.ipynb | 173 ------------------- 1 file changed, 173 deletions(-) delete mode 100644 02_activities/assignments/assignment_1.ipynb diff --git a/02_activities/assignments/assignment_1.ipynb b/02_activities/assignments/assignment_1.ipynb deleted file mode 100644 index 82df84ab2..000000000 --- a/02_activities/assignments/assignment_1.ipynb +++ /dev/null @@ -1,173 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Assignment #1: Anagram Checker\n", - "\n", - "**Background**: Anagram Checker is a program that takes two words and determines if an anagram can be made from it. If so, the program will return `true`, otherwise `false`." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Submission Information\n", - "\n", - "🚨 **Please review our [Assignment Submission Guide](https://github.com/UofT-DSI/onboarding/blob/main/onboarding_documents/submissions.md)** 🚨 for detailed instructions on how to format, branch, and submit your work. Following these guidelines is crucial for your submissions to be evaluated correctly.\n", - "\n", - "### Submission Parameters:\n", - "* Submission Due Date: `11:59 PM - Feb 16, 2025`\n", - "* The branch name for your repo should be: `assignment-1`\n", - "* What to submit for this assignment:\n", - " * This Jupyter Notebook (assignment_1.ipynb) should be populated and should be the only change in your pull request.\n", - "* What the pull request link should look like for this assignment: `https://github.com//python/pull/`\n", - " * 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", - "- [ ] Reviewed the PR description guidelines and adhered to them.\n", - "- [ ] 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 `#dc-help`. Our Technical Facilitators and Learning Support staff are here to help you navigate any challenges." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Part 1: Building the base Anagram Checker\n", - "\n", - "Given two valid strings, check to see if they are anagrams of each other. If it is, return `True`, else `False`. For this part, we can assume that uppercase letters are the same as if it was a lowercase character.\n", - "\n", - "Examples of anagrams:\n", - "* Silent and Listen\n", - "* Night and Think\n", - "\n", - "Example outputs:\n", - "```python\n", - "anagram_checker(\"Silent\", \"listen\") # True\n", - "anagram_checker(\"Silent\", \"Night\") # False\n", - "anagram_checker(\"night\", \"Thing\") # True\n", - "```" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# For testing purposes, we will write our code in the function\n", - "def anagram_checker(word_a, word_b):\n", - " result=True\n", - " word_a=word_a.lower()\n", - " for letter in word_a:\n", - " if letter in word_b:\n", - " result==True \n", - " else:\n", - " result==False \n", - " return result\n", - "\n", - "# Run your code to check using the words below:\n", - "anagram_checker(\"Silent\", \"listen\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "anagram_checker(\"Silent\", \"Night\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "anagram_checker(\"night\", \"Thing\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Part 2: Expanding the functionality of the Anagram Checker\n", - "\n", - "Using your existing and functional anagram checker, let's add a boolean option called `is_case_sensitive`, which will return `True` or `False` based on if the two compared words are anagrams and if we are checking for case sensitivity." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "def anagram_checker(word_a, word_b, is_case_sensitive):\n", - "\n", - " result=True\n", - " if is_case_sensitive==True:\n", - " for letter in word_a:\n", - " if letter in word_b:\n", - " result=True \n", - " result=False \n", - " elif is_case_sensitive==False:\n", - " word_a=word_a.lower()\n", - " word_b=word_b.lower()\n", - " for letter in word_a:\n", - " if letter in word_b:\n", - " result=True \n", - " result=False \n", - " return result \n", - "\n", - "# Run your code to check using the words below:\n", - "anagram_checker(\"Silent\", \"listen\", False) # True" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "anagram_checker(\"Silent\", \"Listen\", True) # False" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "|Criteria|Pass|Fail|\n", - "|---|---|---|\n", - "|Code Execution|All code cells execute without errors.|Any code cell produces an error upon execution.|\n", - "|Code Quality|Code is well-organized, concise, and includes necessary comments for clarity. E.g. Great use of variable names.|Code is unorganized, verbose, or lacks necessary comments. E.g. Single character variable names outside of loops.|" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "new-learner", - "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.8" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 05fe6b949e88a21d277d82b9bf8b39b97012e41e Mon Sep 17 00:00:00 2001 From: Parnia Date: Thu, 20 Feb 2025 15:30:52 -0500 Subject: [PATCH 4/8] Execute the functions Execute the functions to make sure there is no error --- 02_activities/assignments/assignment_1.ipynb | 173 +++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 02_activities/assignments/assignment_1.ipynb diff --git a/02_activities/assignments/assignment_1.ipynb b/02_activities/assignments/assignment_1.ipynb new file mode 100644 index 000000000..82df84ab2 --- /dev/null +++ b/02_activities/assignments/assignment_1.ipynb @@ -0,0 +1,173 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Assignment #1: Anagram Checker\n", + "\n", + "**Background**: Anagram Checker is a program that takes two words and determines if an anagram can be made from it. If so, the program will return `true`, otherwise `false`." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Submission Information\n", + "\n", + "🚨 **Please review our [Assignment Submission Guide](https://github.com/UofT-DSI/onboarding/blob/main/onboarding_documents/submissions.md)** 🚨 for detailed instructions on how to format, branch, and submit your work. Following these guidelines is crucial for your submissions to be evaluated correctly.\n", + "\n", + "### Submission Parameters:\n", + "* Submission Due Date: `11:59 PM - Feb 16, 2025`\n", + "* The branch name for your repo should be: `assignment-1`\n", + "* What to submit for this assignment:\n", + " * This Jupyter Notebook (assignment_1.ipynb) should be populated and should be the only change in your pull request.\n", + "* What the pull request link should look like for this assignment: `https://github.com//python/pull/`\n", + " * 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", + "- [ ] Reviewed the PR description guidelines and adhered to them.\n", + "- [ ] 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 `#dc-help`. Our Technical Facilitators and Learning Support staff are here to help you navigate any challenges." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Part 1: Building the base Anagram Checker\n", + "\n", + "Given two valid strings, check to see if they are anagrams of each other. If it is, return `True`, else `False`. For this part, we can assume that uppercase letters are the same as if it was a lowercase character.\n", + "\n", + "Examples of anagrams:\n", + "* Silent and Listen\n", + "* Night and Think\n", + "\n", + "Example outputs:\n", + "```python\n", + "anagram_checker(\"Silent\", \"listen\") # True\n", + "anagram_checker(\"Silent\", \"Night\") # False\n", + "anagram_checker(\"night\", \"Thing\") # True\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# For testing purposes, we will write our code in the function\n", + "def anagram_checker(word_a, word_b):\n", + " result=True\n", + " word_a=word_a.lower()\n", + " for letter in word_a:\n", + " if letter in word_b:\n", + " result==True \n", + " else:\n", + " result==False \n", + " return result\n", + "\n", + "# Run your code to check using the words below:\n", + "anagram_checker(\"Silent\", \"listen\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "anagram_checker(\"Silent\", \"Night\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "anagram_checker(\"night\", \"Thing\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Part 2: Expanding the functionality of the Anagram Checker\n", + "\n", + "Using your existing and functional anagram checker, let's add a boolean option called `is_case_sensitive`, which will return `True` or `False` based on if the two compared words are anagrams and if we are checking for case sensitivity." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "def anagram_checker(word_a, word_b, is_case_sensitive):\n", + "\n", + " result=True\n", + " if is_case_sensitive==True:\n", + " for letter in word_a:\n", + " if letter in word_b:\n", + " result=True \n", + " result=False \n", + " elif is_case_sensitive==False:\n", + " word_a=word_a.lower()\n", + " word_b=word_b.lower()\n", + " for letter in word_a:\n", + " if letter in word_b:\n", + " result=True \n", + " result=False \n", + " return result \n", + "\n", + "# Run your code to check using the words below:\n", + "anagram_checker(\"Silent\", \"listen\", False) # True" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "anagram_checker(\"Silent\", \"Listen\", True) # False" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "|Criteria|Pass|Fail|\n", + "|---|---|---|\n", + "|Code Execution|All code cells execute without errors.|Any code cell produces an error upon execution.|\n", + "|Code Quality|Code is well-organized, concise, and includes necessary comments for clarity. E.g. Great use of variable names.|Code is unorganized, verbose, or lacks necessary comments. E.g. Single character variable names outside of loops.|" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "new-learner", + "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.8" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 762e6a2023d44f962fffaed3028956f5399fed8e Mon Sep 17 00:00:00 2001 From: Parnia Date: Wed, 26 Feb 2025 14:33:08 -0500 Subject: [PATCH 5/8] Delete 02_activities/assignments/assignment_1.ipynb --- 02_activities/assignments/assignment_1.ipynb | 173 ------------------- 1 file changed, 173 deletions(-) delete mode 100644 02_activities/assignments/assignment_1.ipynb diff --git a/02_activities/assignments/assignment_1.ipynb b/02_activities/assignments/assignment_1.ipynb deleted file mode 100644 index 82df84ab2..000000000 --- a/02_activities/assignments/assignment_1.ipynb +++ /dev/null @@ -1,173 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Assignment #1: Anagram Checker\n", - "\n", - "**Background**: Anagram Checker is a program that takes two words and determines if an anagram can be made from it. If so, the program will return `true`, otherwise `false`." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Submission Information\n", - "\n", - "🚨 **Please review our [Assignment Submission Guide](https://github.com/UofT-DSI/onboarding/blob/main/onboarding_documents/submissions.md)** 🚨 for detailed instructions on how to format, branch, and submit your work. Following these guidelines is crucial for your submissions to be evaluated correctly.\n", - "\n", - "### Submission Parameters:\n", - "* Submission Due Date: `11:59 PM - Feb 16, 2025`\n", - "* The branch name for your repo should be: `assignment-1`\n", - "* What to submit for this assignment:\n", - " * This Jupyter Notebook (assignment_1.ipynb) should be populated and should be the only change in your pull request.\n", - "* What the pull request link should look like for this assignment: `https://github.com//python/pull/`\n", - " * 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", - "- [ ] Reviewed the PR description guidelines and adhered to them.\n", - "- [ ] 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 `#dc-help`. Our Technical Facilitators and Learning Support staff are here to help you navigate any challenges." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Part 1: Building the base Anagram Checker\n", - "\n", - "Given two valid strings, check to see if they are anagrams of each other. If it is, return `True`, else `False`. For this part, we can assume that uppercase letters are the same as if it was a lowercase character.\n", - "\n", - "Examples of anagrams:\n", - "* Silent and Listen\n", - "* Night and Think\n", - "\n", - "Example outputs:\n", - "```python\n", - "anagram_checker(\"Silent\", \"listen\") # True\n", - "anagram_checker(\"Silent\", \"Night\") # False\n", - "anagram_checker(\"night\", \"Thing\") # True\n", - "```" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# For testing purposes, we will write our code in the function\n", - "def anagram_checker(word_a, word_b):\n", - " result=True\n", - " word_a=word_a.lower()\n", - " for letter in word_a:\n", - " if letter in word_b:\n", - " result==True \n", - " else:\n", - " result==False \n", - " return result\n", - "\n", - "# Run your code to check using the words below:\n", - "anagram_checker(\"Silent\", \"listen\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "anagram_checker(\"Silent\", \"Night\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "anagram_checker(\"night\", \"Thing\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Part 2: Expanding the functionality of the Anagram Checker\n", - "\n", - "Using your existing and functional anagram checker, let's add a boolean option called `is_case_sensitive`, which will return `True` or `False` based on if the two compared words are anagrams and if we are checking for case sensitivity." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "def anagram_checker(word_a, word_b, is_case_sensitive):\n", - "\n", - " result=True\n", - " if is_case_sensitive==True:\n", - " for letter in word_a:\n", - " if letter in word_b:\n", - " result=True \n", - " result=False \n", - " elif is_case_sensitive==False:\n", - " word_a=word_a.lower()\n", - " word_b=word_b.lower()\n", - " for letter in word_a:\n", - " if letter in word_b:\n", - " result=True \n", - " result=False \n", - " return result \n", - "\n", - "# Run your code to check using the words below:\n", - "anagram_checker(\"Silent\", \"listen\", False) # True" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "anagram_checker(\"Silent\", \"Listen\", True) # False" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "|Criteria|Pass|Fail|\n", - "|---|---|---|\n", - "|Code Execution|All code cells execute without errors.|Any code cell produces an error upon execution.|\n", - "|Code Quality|Code is well-organized, concise, and includes necessary comments for clarity. E.g. Great use of variable names.|Code is unorganized, verbose, or lacks necessary comments. E.g. Single character variable names outside of loops.|" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "new-learner", - "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.8" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 137a6cedb9c58d7f8103bd1ceecf15d341da8826 Mon Sep 17 00:00:00 2001 From: Parnia Date: Wed, 26 Feb 2025 14:35:01 -0500 Subject: [PATCH 6/8] Add files via upload Modify this code based on the recommendations. --- .../assignments/assignment_1 (1).ipynb | 252 ++++++++++++++++++ 1 file changed, 252 insertions(+) create mode 100644 02_activities/assignments/assignment_1 (1).ipynb diff --git a/02_activities/assignments/assignment_1 (1).ipynb b/02_activities/assignments/assignment_1 (1).ipynb new file mode 100644 index 000000000..08e181b15 --- /dev/null +++ b/02_activities/assignments/assignment_1 (1).ipynb @@ -0,0 +1,252 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "7Whyn8LVs-Sk" + }, + "source": [ + "# Assignment #1: Anagram Checker\n", + "\n", + "**Background**: Anagram Checker is a program that takes two words and determines if an anagram can be made from it. If so, the program will return `true`, otherwise `false`." + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "ig_THQ-Bs-So" + }, + "source": [ + "## Submission Information\n", + "\n", + "🚨 **Please review our [Assignment Submission Guide](https://github.com/UofT-DSI/onboarding/blob/main/onboarding_documents/submissions.md)** 🚨 for detailed instructions on how to format, branch, and submit your work. Following these guidelines is crucial for your submissions to be evaluated correctly.\n", + "\n", + "### Submission Parameters:\n", + "* Submission Due Date: `11:59 PM - Feb 16, 2025`\n", + "* The branch name for your repo should be: `assignment-1`\n", + "* What to submit for this assignment:\n", + " * This Jupyter Notebook (assignment_1.ipynb) should be populated and should be the only change in your pull request.\n", + "* What the pull request link should look like for this assignment: `https://github.com//python/pull/`\n", + " * 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", + "- [ ] Reviewed the PR description guidelines and adhered to them.\n", + "- [ ] 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 `#dc-help`. Our Technical Facilitators and Learning Support staff are here to help you navigate any challenges." + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "w8iQa613s-Sp" + }, + "source": [ + "### Part 1: Building the base Anagram Checker\n", + "\n", + "Given two valid strings, check to see if they are anagrams of each other. If it is, return `True`, else `False`. For this part, we can assume that uppercase letters are the same as if it was a lowercase character.\n", + "\n", + "Examples of anagrams:\n", + "* Silent and Listen\n", + "* Night and Think\n", + "\n", + "Example outputs:\n", + "```python\n", + "anagram_checker(\"Silent\", \"listen\") # True\n", + "anagram_checker(\"Silent\", \"Night\") # False\n", + "anagram_checker(\"night\", \"Thing\") # True\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "7V4wQKWPs-Sp", + "outputId": "4a61a4e4-76db-4849-86ad-a8a7a825db07" + }, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "True" + ] + }, + "metadata": {}, + "execution_count": 10 + } + ], + "source": [ + "def anagram_checker(word_a, word_b):\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\")" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "KizLVtKRs-Sr", + "outputId": "0e59b783-ed4b-402b-c3c9-498b93be61e3" + }, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "False" + ] + }, + "metadata": {}, + "execution_count": 11 + } + ], + "source": [ + "anagram_checker(\"Silent\", \"Night\")" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "UyW16TpGs-Sr", + "outputId": "ea1b9ecd-957a-46d5-9ca2-89ec3e0edfc1" + }, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "True" + ] + }, + "metadata": {}, + "execution_count": 12 + } + ], + "source": [ + "anagram_checker(\"night\", \"Thing\")" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "izoDDdbKs-Sr" + }, + "source": [ + "### Part 2: Expanding the functionality of the Anagram Checker\n", + "\n", + "Using your existing and functional anagram checker, let's add a boolean option called `is_case_sensitive`, which will return `True` or `False` based on if the two compared words are anagrams and if we are checking for case sensitivity." + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "AhLKpJEQs-Ss", + "outputId": "6890a602-76d2-48c3-c503-053cdb73736e" + }, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "True" + ] + }, + "metadata": {}, + "execution_count": 13 + } + ], + "source": [ + "def anagram_checker(word_a, word_b, is_case_sensitive=False):\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", + "# Run your code to check using the words below:\n", + "anagram_checker(\"Silent\", \"listen\", False) # True" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "4YFxO7iLs-Ss", + "outputId": "4645628c-ccd2-4f2d-caa6-e438df64fcb7" + }, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "False" + ] + }, + "metadata": {}, + "execution_count": 14 + } + ], + "source": [ + "anagram_checker(\"Silent\", \"Listen\", True) # False" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "ygUmvTYus-Ss" + }, + "source": [ + "|Criteria|Pass|Fail|\n", + "|---|---|---|\n", + "|Code Execution|All code cells execute without errors.|Any code cell produces an error upon execution.|\n", + "|Code Quality|Code is well-organized, concise, and includes necessary comments for clarity. E.g. Great use of variable names.|Code is unorganized, verbose, or lacks necessary comments. E.g. Single character variable names outside of loops.|" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "new-learner", + "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.8" + }, + "colab": { + "provenance": [] + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file From b2195bdeffabf79a801ceea5448b824e775266f9 Mon Sep 17 00:00:00 2001 From: Parnia Date: Wed, 26 Feb 2025 14:40:39 -0500 Subject: [PATCH 7/8] Delete 02_activities/assignments/assignment_1 (1).ipynb --- .../assignments/assignment_1 (1).ipynb | 252 ------------------ 1 file changed, 252 deletions(-) delete mode 100644 02_activities/assignments/assignment_1 (1).ipynb diff --git a/02_activities/assignments/assignment_1 (1).ipynb b/02_activities/assignments/assignment_1 (1).ipynb deleted file mode 100644 index 08e181b15..000000000 --- a/02_activities/assignments/assignment_1 (1).ipynb +++ /dev/null @@ -1,252 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "7Whyn8LVs-Sk" - }, - "source": [ - "# Assignment #1: Anagram Checker\n", - "\n", - "**Background**: Anagram Checker is a program that takes two words and determines if an anagram can be made from it. If so, the program will return `true`, otherwise `false`." - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "ig_THQ-Bs-So" - }, - "source": [ - "## Submission Information\n", - "\n", - "🚨 **Please review our [Assignment Submission Guide](https://github.com/UofT-DSI/onboarding/blob/main/onboarding_documents/submissions.md)** 🚨 for detailed instructions on how to format, branch, and submit your work. Following these guidelines is crucial for your submissions to be evaluated correctly.\n", - "\n", - "### Submission Parameters:\n", - "* Submission Due Date: `11:59 PM - Feb 16, 2025`\n", - "* The branch name for your repo should be: `assignment-1`\n", - "* What to submit for this assignment:\n", - " * This Jupyter Notebook (assignment_1.ipynb) should be populated and should be the only change in your pull request.\n", - "* What the pull request link should look like for this assignment: `https://github.com//python/pull/`\n", - " * 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", - "- [ ] Reviewed the PR description guidelines and adhered to them.\n", - "- [ ] 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 `#dc-help`. Our Technical Facilitators and Learning Support staff are here to help you navigate any challenges." - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "w8iQa613s-Sp" - }, - "source": [ - "### Part 1: Building the base Anagram Checker\n", - "\n", - "Given two valid strings, check to see if they are anagrams of each other. If it is, return `True`, else `False`. For this part, we can assume that uppercase letters are the same as if it was a lowercase character.\n", - "\n", - "Examples of anagrams:\n", - "* Silent and Listen\n", - "* Night and Think\n", - "\n", - "Example outputs:\n", - "```python\n", - "anagram_checker(\"Silent\", \"listen\") # True\n", - "anagram_checker(\"Silent\", \"Night\") # False\n", - "anagram_checker(\"night\", \"Thing\") # True\n", - "```" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "7V4wQKWPs-Sp", - "outputId": "4a61a4e4-76db-4849-86ad-a8a7a825db07" - }, - "outputs": [ - { - "output_type": "execute_result", - "data": { - "text/plain": [ - "True" - ] - }, - "metadata": {}, - "execution_count": 10 - } - ], - "source": [ - "def anagram_checker(word_a, word_b):\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\")" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "KizLVtKRs-Sr", - "outputId": "0e59b783-ed4b-402b-c3c9-498b93be61e3" - }, - "outputs": [ - { - "output_type": "execute_result", - "data": { - "text/plain": [ - "False" - ] - }, - "metadata": {}, - "execution_count": 11 - } - ], - "source": [ - "anagram_checker(\"Silent\", \"Night\")" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "UyW16TpGs-Sr", - "outputId": "ea1b9ecd-957a-46d5-9ca2-89ec3e0edfc1" - }, - "outputs": [ - { - "output_type": "execute_result", - "data": { - "text/plain": [ - "True" - ] - }, - "metadata": {}, - "execution_count": 12 - } - ], - "source": [ - "anagram_checker(\"night\", \"Thing\")" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "izoDDdbKs-Sr" - }, - "source": [ - "### Part 2: Expanding the functionality of the Anagram Checker\n", - "\n", - "Using your existing and functional anagram checker, let's add a boolean option called `is_case_sensitive`, which will return `True` or `False` based on if the two compared words are anagrams and if we are checking for case sensitivity." - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "AhLKpJEQs-Ss", - "outputId": "6890a602-76d2-48c3-c503-053cdb73736e" - }, - "outputs": [ - { - "output_type": "execute_result", - "data": { - "text/plain": [ - "True" - ] - }, - "metadata": {}, - "execution_count": 13 - } - ], - "source": [ - "def anagram_checker(word_a, word_b, is_case_sensitive=False):\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", - "# Run your code to check using the words below:\n", - "anagram_checker(\"Silent\", \"listen\", False) # True" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "4YFxO7iLs-Ss", - "outputId": "4645628c-ccd2-4f2d-caa6-e438df64fcb7" - }, - "outputs": [ - { - "output_type": "execute_result", - "data": { - "text/plain": [ - "False" - ] - }, - "metadata": {}, - "execution_count": 14 - } - ], - "source": [ - "anagram_checker(\"Silent\", \"Listen\", True) # False" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "id": "ygUmvTYus-Ss" - }, - "source": [ - "|Criteria|Pass|Fail|\n", - "|---|---|---|\n", - "|Code Execution|All code cells execute without errors.|Any code cell produces an error upon execution.|\n", - "|Code Quality|Code is well-organized, concise, and includes necessary comments for clarity. E.g. Great use of variable names.|Code is unorganized, verbose, or lacks necessary comments. E.g. Single character variable names outside of loops.|" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "new-learner", - "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.8" - }, - "colab": { - "provenance": [] - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} \ No newline at end of file From a630d0aeb1fd99d7fe0e1e7dd7a9ccf93f76b30f Mon Sep 17 00:00:00 2001 From: Parnia Date: Wed, 26 Feb 2025 14:41:06 -0500 Subject: [PATCH 8/8] Add files via upload Modify the code and address all the comments --- 02_activities/assignments/assignment_1.ipynb | 252 +++++++++++++++++++ 1 file changed, 252 insertions(+) create mode 100644 02_activities/assignments/assignment_1.ipynb diff --git a/02_activities/assignments/assignment_1.ipynb b/02_activities/assignments/assignment_1.ipynb new file mode 100644 index 000000000..08e181b15 --- /dev/null +++ b/02_activities/assignments/assignment_1.ipynb @@ -0,0 +1,252 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "7Whyn8LVs-Sk" + }, + "source": [ + "# Assignment #1: Anagram Checker\n", + "\n", + "**Background**: Anagram Checker is a program that takes two words and determines if an anagram can be made from it. If so, the program will return `true`, otherwise `false`." + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "ig_THQ-Bs-So" + }, + "source": [ + "## Submission Information\n", + "\n", + "🚨 **Please review our [Assignment Submission Guide](https://github.com/UofT-DSI/onboarding/blob/main/onboarding_documents/submissions.md)** 🚨 for detailed instructions on how to format, branch, and submit your work. Following these guidelines is crucial for your submissions to be evaluated correctly.\n", + "\n", + "### Submission Parameters:\n", + "* Submission Due Date: `11:59 PM - Feb 16, 2025`\n", + "* The branch name for your repo should be: `assignment-1`\n", + "* What to submit for this assignment:\n", + " * This Jupyter Notebook (assignment_1.ipynb) should be populated and should be the only change in your pull request.\n", + "* What the pull request link should look like for this assignment: `https://github.com//python/pull/`\n", + " * 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", + "- [ ] Reviewed the PR description guidelines and adhered to them.\n", + "- [ ] 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 `#dc-help`. Our Technical Facilitators and Learning Support staff are here to help you navigate any challenges." + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "w8iQa613s-Sp" + }, + "source": [ + "### Part 1: Building the base Anagram Checker\n", + "\n", + "Given two valid strings, check to see if they are anagrams of each other. If it is, return `True`, else `False`. For this part, we can assume that uppercase letters are the same as if it was a lowercase character.\n", + "\n", + "Examples of anagrams:\n", + "* Silent and Listen\n", + "* Night and Think\n", + "\n", + "Example outputs:\n", + "```python\n", + "anagram_checker(\"Silent\", \"listen\") # True\n", + "anagram_checker(\"Silent\", \"Night\") # False\n", + "anagram_checker(\"night\", \"Thing\") # True\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "7V4wQKWPs-Sp", + "outputId": "4a61a4e4-76db-4849-86ad-a8a7a825db07" + }, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "True" + ] + }, + "metadata": {}, + "execution_count": 10 + } + ], + "source": [ + "def anagram_checker(word_a, word_b):\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\")" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "KizLVtKRs-Sr", + "outputId": "0e59b783-ed4b-402b-c3c9-498b93be61e3" + }, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "False" + ] + }, + "metadata": {}, + "execution_count": 11 + } + ], + "source": [ + "anagram_checker(\"Silent\", \"Night\")" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "UyW16TpGs-Sr", + "outputId": "ea1b9ecd-957a-46d5-9ca2-89ec3e0edfc1" + }, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "True" + ] + }, + "metadata": {}, + "execution_count": 12 + } + ], + "source": [ + "anagram_checker(\"night\", \"Thing\")" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "izoDDdbKs-Sr" + }, + "source": [ + "### Part 2: Expanding the functionality of the Anagram Checker\n", + "\n", + "Using your existing and functional anagram checker, let's add a boolean option called `is_case_sensitive`, which will return `True` or `False` based on if the two compared words are anagrams and if we are checking for case sensitivity." + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "AhLKpJEQs-Ss", + "outputId": "6890a602-76d2-48c3-c503-053cdb73736e" + }, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "True" + ] + }, + "metadata": {}, + "execution_count": 13 + } + ], + "source": [ + "def anagram_checker(word_a, word_b, is_case_sensitive=False):\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", + "# Run your code to check using the words below:\n", + "anagram_checker(\"Silent\", \"listen\", False) # True" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "4YFxO7iLs-Ss", + "outputId": "4645628c-ccd2-4f2d-caa6-e438df64fcb7" + }, + "outputs": [ + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "False" + ] + }, + "metadata": {}, + "execution_count": 14 + } + ], + "source": [ + "anagram_checker(\"Silent\", \"Listen\", True) # False" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "ygUmvTYus-Ss" + }, + "source": [ + "|Criteria|Pass|Fail|\n", + "|---|---|---|\n", + "|Code Execution|All code cells execute without errors.|Any code cell produces an error upon execution.|\n", + "|Code Quality|Code is well-organized, concise, and includes necessary comments for clarity. E.g. Great use of variable names.|Code is unorganized, verbose, or lacks necessary comments. E.g. Single character variable names outside of loops.|" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "new-learner", + "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.8" + }, + "colab": { + "provenance": [] + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file