Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
def count_occurrences(phrase: str, letter: str) -> int:
# write your code here
pass
"""
Count occurrences of a letter in a phrase (case insensitive).

Parameters:
phrase (str): The string in which to search for the letter.
letter (str): The letter to count within the phrase.

Returns:
int: The number of occurrences of the letter in the phrase.
"""
string_lower = phrase.lower()
return string_lower.count(letter.lower())