Conversation
juliagallucci
left a comment
There was a problem hiding this comment.
Good job on implementing the anagram checker! Your approach using a dictionary for character counting works, but it can be simplified. Instead of manually tracking character frequencies, you can use Python’s built-in functions. By converting both words to either upper or lowercase and sorting their letters, you can achieve the same result in a more concise and readable way.
Simplified the code. Sorry I was not sure if we were allowed to use pythons in built function or not. Although i believe pythons counter is basically a hash map itself if i am not wrong? |
What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)
Added code to assignment1 notebook.
What did you learn from the changes you have made?
Basic python coding such as loops and functions.
Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
Python has a built in function to count the number of occurences of characters in a word.
Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
How were these changes tested?
Test cases were given in the notebook itself.
A reference to a related issue in your repository (if applicable)
Checklist