Skip to content

Commit

Permalink
Solution v3
Browse files Browse the repository at this point in the history
  • Loading branch information
MrEgorLite committed Sep 23, 2024
1 parent f0ea768 commit 7197efc
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,4 @@ def count_occurrences(phrase: str, letter: str) -> int:
:param letter: letter to find occurrences of it
:return: count occurrences of letter in phrase
"""
out = 0
for char in phrase:
if (char.lower() == letter.lower()):
out += 1
return out
return phrase.lower().count(letter.lower())

0 comments on commit 7197efc

Please sign in to comment.