Skip to content

Completed the assignment 1 for python class#1

Open
darlingoscanoa wants to merge 3 commits intomainfrom
assignment-1
Open

Completed the assignment 1 for python class#1
darlingoscanoa wants to merge 3 commits intomainfrom
assignment-1

Conversation

@darlingoscanoa
Copy link
Copy Markdown
Owner

TITLE: UofT-DSI | Python - Assignment 1

What changes are you trying to make?

I have added the functions for both scenarios no case sensitive and case sensitive to check if a couple of words are anagrams or not

What did you learn from the changes you have made?

I learned how to use functions and think in a step-by-step approach In my case, I started by thinking about how to count the letters in a word to reuse that in my function for non-case-sensitive and case-insensitive. Finally, in the case of the final function providing a third argument "is_case_sensitive," I then recall my two previous functions.

Was there another approach you were thinking about making?

Well, I think there are many ways to do this job. At the begining, I was thinking to use 2 for loops but then the functions became complicated, then i moved to create a function to count the letters in a word. Then i remembered there is a function to count those words, but the work was done, so I kept it. On the other hand, I also thought that maybe putting all those letters in just one single string by sorting and comparing could be another way

Were there any challenges?

Well the indentation give me some surprise when the code was not running mostly because of that.

How were these changes tested?

I tested the functions with the case provided and also with some others

Checklist

  • I can confirm that my changes are working as intended
  • I have tested the functions with different cases, and it works as expected

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.

Code is functional, but it could be simplified using fewer lines with sorted() and string methods. No need to build a helper function. Please revise

@darlingoscanoa
Copy link
Copy Markdown
Owner Author

Update the assignment-1 script by following the recommendations to reduce complexity and improve clarity

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.

No need to create separate functions for part B. Your code should use the third argument is_case_sensitive and return output based on whether that condition is met or not. Please revise

…the third argument is_case_sensitive as requested
@darlingoscanoa
Copy link
Copy Markdown
Owner Author

Thanks, Julia for your comments and feedback. I really appreciate it.

At the begining, I put it in that way because I thought it was easier for notebook readability and code maintenance. However, you are right, the task was asked for in one way, we need to follow the instructions. Also I learn today how to deal and switch back my local copy from the branch assignment-2, because that was the latest branch we worked and also because fortunately I made those branch independents (branchs from the main), so I didnt have issues by changing back the branch (git status, git checkout assignment-1 and I saw how the files update in my local computer after I made that on git bash) and then update my code just by moving the block code logic from the functions that i defined before to the function requested.

Thanks again!

"Update file assingment-1 without creating the separated function for the third argument is_case_sensitive as requested"

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!

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