Skip to content

Commit

Permalink
remove comments and use first sulution
Browse files Browse the repository at this point in the history
  • Loading branch information
Mxbely committed Sep 18, 2024
1 parent ccc114a commit df0474c
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,5 @@ def count_occurrences(phrase: str, letter: str) -> int:
:param letter: letter to find occurrences of it
:return: count occurrences of letter in phrase
"""
# first solution
# return phrase.lower().count(letter.lower())

# second solution
count = 0

for letters in phrase:
if letter.upper() == letters.upper():
count += 1

return count
return phrase.lower().count(letter.lower())

0 comments on commit df0474c

Please sign in to comment.