-
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
Create file_new_for_test #1923
base: master
Are you sure you want to change the base?
Create file_new_for_test #1923
Conversation
Create file_new_for_test
Comment new |
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.
Tests Failed!
please fix the code so that it passes all tests
Solution to master
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.
Several changes were requested
app/main.py
Outdated
occurrences_count = 0 | ||
for letter_phrase in phrase.lower(): | ||
if letter_phrase == letter.lower(): | ||
occurrences_count += 1 | ||
return occurrences_count |
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.
Please, try to implement this function in one line using chaining and built-in string methods to avoid variable allocation and a loop
app/main.py
Outdated
return occurrences_count | ||
|
||
|
||
print(count_occurrences("letter", "t")) |
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.
Remove this line
file_new_for_test
Outdated
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.
Remove this file, there is no need to commit it
Solution after changes
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.
GJ!
Create file_new_for_test