Skip to content

completed part 1 and 2#1

Open
ykmlee wants to merge 2 commits intomainfrom
assignment-1
Open

completed part 1 and 2#1
ykmlee wants to merge 2 commits intomainfrom
assignment-1

Conversation

@ykmlee
Copy link
Copy Markdown
Owner

@ykmlee ykmlee commented Mar 12, 2026

What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)

What did you learn from the changes you have made?

Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?

Were there any challenges? If so, what issue(s) did you face? How did you overcome it?

How were these changes tested?

A reference to a related issue in your repository (if applicable)

Checklist

  • I can confirm that my changes are working as intended

Copy link
Copy Markdown

@juliagallucci juliagallucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're close! For part B, the logic is incorrect- the expression (is_case_sensitive == (sorted(word_a) == sorted(word_b))) only compares the sorted original words to the is_case_sensitive flag, which does not correctly enforce case-sensitive checks for all letters.

A better approach is to convert both words to lowercase only if is_case_sensitive is False, then simply compare sorted(word_a) and sorted(word_b); this correctly handles both case-sensitive and case-insensitive anagram checking.

Please revise

juliagallucci

This comment was marked as duplicate.

@ykmlee
Copy link
Copy Markdown
Owner Author

ykmlee commented Mar 17, 2026

You're close! For part B, the logic is incorrect- the expression (is_case_sensitive == (sorted(word_a) == sorted(word_b))) only compares the sorted original words to the is_case_sensitive flag, which does not correctly enforce case-sensitive checks for all letters.

A better approach is to convert both words to lowercase only if is_case_sensitive is False, then simply compare sorted(word_a) and sorted(word_b); this correctly handles both case-sensitive and case-insensitive anagram checking.

Please revise

Hi Julia,
I've corrected my Part B. I hope this works.

Yvonne

Copy link
Copy Markdown

@juliagallucci juliagallucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants