Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)
I wrote code for an anagram checker with an option for case-sensitive checking.
What did you learn from the changes you have made?
I learned the importance of code logic and how to make code more efficient using inverted logic. I also learned how to check the results of each component of a function for debugging.
Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
When writing the code for the case sensitive section, I was thinking about whether I could combine the case sensitive parameter with the word length parameter instead of adding it as another nested if statement.
Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
The main challenge I had was in the first section because I was not paying attention to case sensitivity. I thought "Silent" had a lowercase "s" so I couldn't figure out why I wasn't getting the right output. Then, I realized I had to add this consideration to the code. The other thing was using inverted logic. I was writing the code to check if all the conditions were satisfied instead of making the function look for any condition that was not satisfied. When I switched to the latter, writing the code became easier.
How were these changes tested?
I tested the script using some print functions for each component of the anagram checker. Then I used the test cases provided. I also checked online for other functions that could work for this assignment. I found that despite the fact that my code works, it isn't a perfect anagram checker and there are some nuances that if addressed would make the code work better. E.g. comparing words with the same letters and same length but different number of each letter such as banana vs nababa.
A reference to a related issue in your repository (if applicable)
N/A
Checklist