-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Min integer Challenge #53
Conversation
Completed the self-assigned Min Integer challenge, I've also added my learning goals to the markdown file in the collaboration directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Tamir, the code works well and all tests pass, however, I think there're few edits that need to be made before merging.
-
The test class name should be in PascalCase. It should be "Class TestMinInteger(unittest.TestCase)".
-
There's a small spelling mistake in line 32 in the test file. Should be "test_min_at_beginning".
-
The code is fine and has no issues, however, it does more than its description. For example, the description states that the returns need to be an int, there're tests with floats and strings, so in this case the test should raise an error instead of passing, and for this to happen, there needs to be an assertion to make sure that all elements are int so it could return an int. I'd suggest adding
Assert isinstance(element, int), "all elements must be integers"
and an assertion error if input is not int.
-
In the test file, in line 63, the return is "Brennan" which in this case does not necessarily add up to how the function works. The string with the least amount of letters is "my" and "is", however, the return is "Brennan" because it returns the least index which in this case is 1, and not actually the word with the least amount of letters, and I don't think this aligns with the main purpose of the function.
-
Since the function's name is "Min-Integer" I'd suggest making it only about integers without adding strings or floats. It would make sense to add floats incase both the return and elements statements state that they could be either int or float. However, I think it'd be better to exclude strings in this case.
Overall, the code works just fine but it does more than what the function description says. Best of luck!!
Hello Alaa, I greatly appreciate the attention to details that you've put into reviewing the code. Accordingly:
As for your other suggestions, I've put them into consideration, and I agree the function does more than required. Although, this was my interpretation of the behavior, I'll definitely consider this perspective in any future challenges going forward. Truly appreciated, and if there any other suggestions please let me know. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All is good!!
name: solution review
about: A template PR for code review with a checklist
Behavior
Files
/tests/test_file_name.py
Unit Tests
Function Docstring
Raises:
The Function
Strategy
Do's
Don'ts
Implementation
when it's too restricting.
print
statements anywhere