Skip to content

UofT-DSI | <Python> - Assignment <1>#1

Open
MinsangKim-Data wants to merge 4 commits intomainfrom
assignment-1
Open

UofT-DSI | <Python> - Assignment <1>#1
MinsangKim-Data wants to merge 4 commits intomainfrom
assignment-1

Conversation

@MinsangKim-Data
Copy link
Copy Markdown
Owner

@MinsangKim-Data MinsangKim-Data commented Aug 30, 2024

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

I am adding code that fulfills the anagram_checker function requirements.
I am also checking that the code works fine with the example arguments.

What did you learn from the changes you have made?

I learned the if statements within the writing of the function. Overall, this helped me understand control flow better, and the differences between lists, tuples, sets, and their mutability/immutability.

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

At first, I thought using sets would be a good idea. But I realized when doing the write-up that sets would make the string get rid of multiple values, so the function using sets would not catch multiples of the same letter in the word. Therefore, I changed my function to lists which would preserve the letters of the string that would be inputted in as arguments.

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

In retrospect, in wouldn't have mattered so much because if both strings/words were truly anagrams of each other, making them into sets will have made them the same both sides of the equality operator (==). Regardless, I made them into lists and then reordered them by using .sort() then applied the equality operator to see if they were anagrams.

How were these changes tested?

These changes were tested with the example arguments. They tested out to be the expected results.

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

n/a

Checklist

  • I can confirm that my changes are working as intended

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