Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
OLypovenko committed Oct 19, 2024
1 parent 7e7a3ee commit 7123a1c
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
@@ -1,3 +1,6 @@
from idlelib.configdialog import changes


def count_occurrences(phrase: str, letter: str) -> int:
"""
Implement count_occurrences function:
Expand All @@ -14,4 +17,8 @@ def count_occurrences(phrase: str, letter: str) -> int:
:param letter: letter to find occurrences of it
:return: count occurrences of letter in phrase
"""
# write your code here
count = 0
for char in phrase:
if char.lower() == letter.lower():
count += 1
return count

0 comments on commit 7123a1c

Please sign in to comment.