Skip to content

Conversation

@amera6
Copy link
Owner

@amera6 amera6 commented Oct 25, 2025

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

I added my own python code to the assignment_1 jupyter notebook so that the anagram_checker function would work properly, as outlined in the instructions.

What did you learn from the changes you have made?

I was surprised about the utility of the sort() function which I never really paid much attention to in my previous python courses. In this assignment, it was integral for creating comparable lists where each element is a letter from the inputted words. Also, I'm familiar with the .append() method but this is the first time that I've applied the .extend() method.

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

I was initially thinking about using nested for-loops. I would first create two lists, one corresponding to each inputted word, that would contain each of the letters in the word as elements. Then, I would iterate over the elements in one list and check if each letter is contained within the opposing word (i.e., if a letter from string_a is in word_b), and then I would do the same check but in the opposite direction (i.e., check if each letter from string_b is in word_a). If either of these returns FALSE at any point, the result is that the two words are not anagrams.

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

I was having trouble seeing my changes in the local repo show up online when making this pull request. I had to delete the branch and retry in case I made a mistake along the way. I also kept getting errors when trying to clone the repo in bash. In actuality, the wifi connection on my train was not reliable and it kept causing fatal errors due to frequent disconnections. Once I got home and was able to get a reliable connection, I was able to clone the repo, make my revisions, commit and push my changes here.

How were these changes tested?

I tested out the code in a separate jupyter notebook, in which I ran the cells each time that I made a change to the code. Then I pasted the code to the actual assignment notebook, and ran the cells that checked if the words were anagrams.

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

Checklist

  • I can confirm that my changes are working as intended

Copy link

@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! One note for improvement, you don’t need to explicitly return True or False since the comparison itself already evaluates to a Boolean.

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.

3 participants