Conversation
juliagallucci
left a comment
There was a problem hiding this comment.
Good job outlining your logic step by step. Your code correctly lowers case and compares lengths, but placing return inside the loop causes it to exit after the first letter, so moving the return statement outside or using sorted() will fix this and make the anagram check accurate. Please revise.
juliagallucci
left a comment
There was a problem hiding this comment.
Good attempt, however, there’s a logical issue: it checks only whether all letters in word_b appear in word_a, not whether they appear the same number of times. Example, anagram_checker("aab", "abb") would incorrectly return True. Please revise.
juliagallucci
left a comment
There was a problem hiding this comment.
Good attempt. For part b, your current code always converts both words to lowercase before performing either the case-sensitive or case-insensitive comparison. That means it removes case information too early, so even when is_case_sensitive=True. Please revise
juliagallucci
left a comment
There was a problem hiding this comment.
Great! One note for improvement, you don’t need to explicitly return True or False since the comparison itself already evaluates to a Boolean.
What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)
Completed the assignment by completing the code.
What did you learn from the changes you have made?
How to use python to check if two words are anagrams of each other, as well as whether if they are case sensitive.
Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
I used a lot of embedding to check one condition at a time. However, I think there might be other more concise approaches that checks if more than one conditions are satisfied at the same time.
Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
Trying to figure out the logic, but it was really fun!
How were these changes tested?
I tested the code at intermediate steps.
A reference to a related issue in your repository (if applicable)
Checklist