Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions 02_activities/assignments/assignment_1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -65,21 +65,21 @@
"True"
]
},
"execution_count": 27,
"execution_count": 47,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# For testing purposes, we will write our code in the function\n",
"# resumbitting after a merge reversal. For testing purposes, we will write our code in the function\n",
"def anagram_checker(word_a, word_b):\n",
" #converted both inputs to lowercase so both words are no longer case sensitive \n",
" word_a = word_a.lower()\n",
" word_b = word_b.lower()\n",
" #sort the characters of both words alphabetically\n",
" sorted_a = sorted(word_a)\n",
" sorted_b = sorted(word_b)\n",
" #returns a value of 'True' if both sorted words are equal (it's an anagram), if not, returns a value of 'False' (not an anagram)\n",
" #returns a value of 'True' if both sorted words are equal (it's an anagram). If not, returns a value of 'False' (not an anagram)\n",
" return sorted_a == sorted_b\n",
"# Run your code to check using the words below:\n",
"anagram_checker(\"Silent\", \"listen\")"
Expand Down