Skip to content
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

Develop #1928

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Develop #1928

wants to merge 2 commits into from

Conversation

yuliiayedynak
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Great job on implementing the count_occurrences function! 🎉 Your solution meets the task requirements by correctly counting the occurrences of a letter in a phrase, while being case insensitive. Just a small tweak is needed to ensure the function returns an integer instead of a float. Simply remove the division operator and directly return the result of phrase.lower().count(letter.lower()). Keep up the great work! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

Comment on lines +2 to +3

return phrase.lower().count(letter.lower())

Choose a reason for hiding this comment

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

The return statement is currently returning a float because the count method returns an integer, but the division operator / is used, which results in a float. To fix this, you should remove the division operator and directly return the result of phrase.lower().count(letter.lower()) to ensure the function returns an integer as specified in the function signature.

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