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
7 changes: 6 additions & 1 deletion 02_activities/assignments/assignment_1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"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",
"* Silent and Listen\n",
"* Night and Think\n",
"\n",
"Example outputs:\n",
Expand All @@ -63,6 +63,7 @@
"# For testing purposes, we will write our code in the function\n",
"def anagram_checker(word_a, word_b):\n",
" # Your code here\n",
" return sorted(word_a.lower()) == sorted(word_b.lower())",
"\n",
"# Run your code to check using the words below:\n",
"anagram_checker(\"Silent\", \"listen\")"
Expand Down Expand Up @@ -103,6 +104,10 @@
"source": [
"def anagram_checker(word_a, word_b, is_case_sensitive):\n",
" # Modify your existing code here\n",
" if is_case_sensitive == True:\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"
Expand Down