Skip to content

Commit

Permalink
fixed in one row
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitalii-Kr committed Oct 19, 2023
1 parent b038e5a commit e7e6349
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +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
"""
count = 0

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

return count
return sum(1 for char in phrase if char.lower() == letter.lower())

0 comments on commit e7e6349

Please sign in to comment.