Skip to content

Commit

Permalink
code fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslan-sketch committed Aug 19, 2023
1 parent 021d19f commit f3bd3d6
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
def count_occurrences(phrase: str, letter: str) -> int:


return phrase.count(letter)

# Test examples
assert count_occurrences('letter', 't') == 2
assert count_occurrences('kitten', 't') == 2
assert count_occurrences('Happy New Year!', 'p') == 2
assert count_occurrences("letter", "t") == 2
assert count_occurrences("kitten", "t") == 2
assert count_occurrences("Happy New Year!", "p") == 2






0 comments on commit f3bd3d6

Please sign in to comment.