Skip to content

Assignment#1

Open
Alexfom0412 wants to merge 1 commit intomainfrom
assignment-1
Open

Assignment#1
Alexfom0412 wants to merge 1 commit intomainfrom
assignment-1

Conversation

@Alexfom0412
Copy link
Copy Markdown
Owner

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

Adding code for string length check, changing strings to lower case, and sorting strings

What did you learn from the changes you have made?

I learnt how to define a function, use logic operators and conditionals

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

No

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

Part 2 of the assignment, as I did not think of using the NOT logic operator right away

How were these changes tested?

Using Visual Studio Code on my laptop

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

Checklist

  • I can confirm that my changes are working as intended

@Alexfom0412 Alexfom0412 changed the title Final file for submission Assignment Feb 16, 2025
" sorted_word_b = sorted(word_b)\n",
"\n",
"# If sorted strings are the same, return True \n",
" return sorted_word_a == sorted_word_b\n",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All the codes can be consolidated to one line:
return sorted(word_a.lower()) == sorted(word_b.lower())

" # Your code here\n",
" \n",
"# Checking string lengths to see if they can be anagrams\n",
" if len (word_a) != len (word_b):\n",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is not necessary, but good thinking!

Copy link
Copy Markdown

@kelichiu kelichiu left a comment

Choose a reason for hiding this comment

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

Pass

Code Execution

All code cells execute without errors.

Code Quality

  • Code is well-organized, but not concise.
  • Codes includes necessary comments for clarity.
  • Great use of variable names.

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