Conversation
juliagallucci
left a comment
There was a problem hiding this comment.
You're on the right track. For part B, your code does not correctly handle case sensitivity, because it ignores converting the words to lowercase when is_case_sensitive is False. Comparing sorted(word_a) == sorted(word_b) will be case-sensitive by default, so the == is_case_sensitive at the end does not achieve the intended behavior.
To fix it, you should convert the words to lowercase only when is_case_sensitive is False, then compare the sorted letters and return that Boolean directly. Please revise
|
Hi Julia, Thank you very much for the feedback. I made a revision as requested. What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)I added code in Part 2 to add a boolean option, named as is_case_sensitive What did you learn from the changes you have made?how to use functions if() and else() Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?NA Were there any challenges? If so, what issue(s) did you face? How did you overcome it?How were these changes tested?by executing codes A reference to a related issue in your repository (if applicable)Checklist
|
What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)
Adding codes to build a anagram checker
What did you learn from the changes you have made?
how to use functions 'sorted()' and boolean.
Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
NA
Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
Part 2 was complicated. I tried different codes before I finally managed to succeed it. I defined is_case_sensitive as return(sorted(word_a) == sorted(word_b)) == is_case_sensitive
How were these changes tested?
by executing codes
A reference to a related issue in your repository (if applicable)
Checklist