Skip to content

updated the assignment_1 for review#1

Merged
datatoinsights merged 1 commit intomainfrom
assignment
May 9, 2024
Merged

updated the assignment_1 for review#1
datatoinsights merged 1 commit intomainfrom
assignment

Conversation

@datatoinsights
Copy link
Copy Markdown
Owner

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

 Adding assignment 1

What did you learn from the changes you have made?

 To create 3 versions of anagram checker using python, I have got more familiar with python functions and methods when using them to solve a problem.

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

I was initially comparing each indexed letter from the word, which would need to use loops. Then I realize once the list is ordered, I can compare the two entire list. This way, the code is easier to understand without using loops.

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

For the 3rd scenario, it was hard to sort the order of the words for comparison, as the first letter of the word does not necessarily decides which word from each list should be compared. Then also the upper case also got in the way of sorting the word. So I googled a way of uppercase the list of words, separate the words into single letters, then sort letters for each word, then sort the order of list of letters. This way, the same indexed word from both lists can be compared.

How were these changes tested?

They were tested with both positive and negative tests, using different parameters, like different combination of words with different uppercased letters, or with different case-sensitive requirements.

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

n/a

@mentions of the person or team responsible for reviewing proposed changes (At least 2 people)

  • It seems we were discouraged to tag anyone for assignment.

Checklist

  • I can confirm that my changes are working as intended
    Yes

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.

Good! Your code executes without error and is well commented. One suggestion would be to make your code more concise when possible. For instance, you dont have to specify True/False for a conditional statement. See below for example of Part A written as 2 lines of code

def anagram_checker(word_a, word_b):
return sorted(word_a.lower()) == sorted(word_b.lower())

@datatoinsights datatoinsights merged commit c787ac2 into main May 9, 2024
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