-
Couldn't load subscription status.
- Fork 2.5k
test 1st commit #3064
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
test 1st commit #3064
Conversation
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.
Review Summary
This requires changes because the core functionality is missing and blocks the task from being completed. In app/main.py, the function body is empty at the implementation line (currently pass), so it does not return the required case-insensitive count and will cause tests to fail. The requirement is to implement count_occurrences(phrase: str, letter: str) -> int that counts occurrences regardless of case and includes a docstring describing parameters and return value.
Critical issues to fix:
- Line with
pass: replace with logic that normalizes case on both inputs and returns the count (e.g.,phrase.lower().count(letter.lower())). This fulfills the case-insensitive counting requirement. - Add a docstring to
count_occurrencesdetailing: parameters (phrase,letter), behavior (case-insensitive counting), and the integer return value.
Minor improvements (optional):
- Consider using
casefold()instead oflower()for better Unicode handling.
Once you implement the function and add the docstring, the solution should meet the requirements. Keep going—you’re close, and your existing signature and type hints are a solid start!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
app/main.py
Outdated
| def count_occurrences(phrase: str, letter: str) -> int: | ||
| # write your code here | ||
| pass | ||
|
|
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.
Function body is empty (only pass). Implement the required behavior: add a docstring and return the case-insensitive count, e.g. return phrase.lower().count(letter.lower()). See the task description for required signature and docstring details .
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.
Review Summary
Great job on the core logic for the count_occurrences function! It works correctly and handles the case-insensitive requirement perfectly.
However, this submission needs one change to meet all requirements. The function is missing its docstring, which is a specific requirement of this task. The docstring is essential for explaining the function's purpose, its parameters, and what it returns.
Please add the docstring exactly as provided in the task description to complete the exercise.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
| @@ -1,3 +1,2 @@ | |||
| def count_occurrences(phrase: str, letter: str) -> int: | |||
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.
The function implementation is correct, which is excellent progress! However, the task requires a docstring that explains the function's purpose, parameters, and return value. Please add the docstring as shown in the task description.
|
Fixed |
No description provided.