Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
vmyronets committed Sep 19, 2024
1 parent dca5d74 commit e3bb8e1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ def count_occurrences(phrase: str, letter: str) -> int:
:param letter: letter to find occurrences of it
:return: count occurrences of letter in phrase
"""
count_letter = 0

for character in phrase.lower():
if character == letter.lower():
count_letter += 1
count_letter = phrase.lower().count(letter.lower())

return count_letter

0 comments on commit e3bb8e1

Please sign in to comment.