Skip to content
Closed
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
11 changes: 10 additions & 1 deletion 02_activities/assignments/assignment_1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,16 @@
"source": [
"def anagram_checker(word_a, word_b, is_case_sensitive):\n",
" # Modify your existing code here\n",
"\n",
" if is_case_sensitive == True:\n",
" if len(word_a) == len(word_b) and sorted(word_a) == sorted(word_b):\n",
" return True\n",
" else:\n",
" return False\n",
" if is_case_sensitive == False:\n",
" if len(word_a) == len(word_b) and sorted(word_a.lower()) == sorted(word_b.lower()):\n",
" return True\n",
" else:\n",
" return False\n",
"# Run your code to check using the words below:\n",
"anagram_checker(\"Silent\", \"listen\", False) # True"
]
Expand Down