Skip to content

UofT-DSI | Python - Assignment 1#1

Merged
JillyKim merged 2 commits intomainfrom
assignment-1
Mar 17, 2026
Merged

UofT-DSI | Python - Assignment 1#1
JillyKim merged 2 commits intomainfrom
assignment-1

Conversation

@JillyKim
Copy link
Copy Markdown
Owner

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

  • 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 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

@JillyKim
Copy link
Copy Markdown
Owner Author

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

  • 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.

Great!

@JillyKim JillyKim merged commit 02d7835 into main Mar 17, 2026
1 check passed
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