-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
'Solution' #1934
base: master
Are you sure you want to change the base?
'Solution' #1934
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.
It looks like there's a small issue with the return statement in your count_occurrences
function. Instead of returning the count directly, it's currently performing a division, which isn't what we want. Please adjust the return statement to simply return the count of occurrences. Once that's fixed, your solution will be spot on! Keep up the great work! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review
button in the Reviewers tab.
app/main.py
Outdated
@@ -1,3 +1,2 @@ | |||
def count_occurrences(phrase: str, letter: str) -> int: | |||
# write your code here | |||
pass | |||
return phrase.lower().count(letter.lower()) |
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 return statement is incorrect. It currently divides the count of occurrences by the length of the string, which is not the intended functionality. You should return the count directly without division to get the number of occurrences of the letter in the phrase.
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.
Your implementation of the count_occurrences
function is correct and meets the task requirements. 🎉 The function effectively counts the occurrences of a letter in a given phrase in a case-insensitive manner, using Python's built-in string method count
. This approach is efficient and aligns well with the task constraints.
Great job on following the task requirements closely! Keep up the good work, and remember to always review any feedback to further enhance your coding skills. If there are any issues or improvements suggested in the comments, consider them as opportunities to learn and grow. Keep coding and improving! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
No description provided.