diff --git a/02_activities/assignments/assignment_1.ipynb b/02_activities/assignments/assignment_1.ipynb index bee48d5a0..6b8c1d046 100644 --- a/02_activities/assignments/assignment_1.ipynb +++ b/02_activities/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", + "- [√] 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", @@ -56,13 +56,27 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True\n" + ] + } + ], "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", + " word_a = word_a.lower()\n", + " word_b = word_b.lower()\n", + " if sorted(word_a) == sorted(word_b):\n", + " enter =True\n", + " else: \n", + " enter = False\n", + " print (enter)\n", "\n", "# Run your code to check using the words below:\n", "anagram_checker(\"Silent\", \"listen\")" @@ -70,18 +84,34 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "False\n" + ] + } + ], "source": [ "anagram_checker(\"Silent\", \"Night\")" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True\n" + ] + } + ], "source": [ "anagram_checker(\"night\", \"Thing\")" ] @@ -97,12 +127,33 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 34, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "True\n" + ] + } + ], "source": [ "def anagram_checker(word_a, word_b, is_case_sensitive):\n", " # Modify your existing code here\n", + " if is_case_sensitive:\n", + " if sorted(word_a) == sorted (word_b):\n", + " enter =True\n", + " else:\n", + " enter = False\n", + " else:\n", + " word_a = word_a.lower()\n", + " word_b = word_b.lower()\n", + " if sorted (word_a) == sorted (word_b):\n", + " enter = True\n", + " else:\n", + " enter= False\n", + " print (enter)\n", "\n", "# Run your code to check using the words below:\n", "anagram_checker(\"Silent\", \"listen\", False) # True" @@ -110,9 +161,17 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 35, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "False\n" + ] + } + ], "source": [ "anagram_checker(\"Silent\", \"Listen\", True) # False" ] @@ -130,7 +189,7 @@ ], "metadata": { "kernelspec": { - "display_name": "new-learner", + "display_name": "3.11.3", "language": "python", "name": "python3" }, @@ -144,7 +203,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.8" + "version": "3.11.3" } }, "nbformat": 4,