Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
lurd22 committed Oct 11, 2024
1 parent ba71634 commit e9d7556
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,11 @@ def count_occurrences(phrase: str, letter: str) -> int:
:param letter: letter to find occurrences of it
:return: count occurrences of letter in phrase
"""
return phrase.lower().count(letter.lower())

counter = 0

for char in phrase:
if char.lower() == letter.lower():
counter += 1

return counter

0 comments on commit e9d7556

Please sign in to comment.