From 09336a4eaf866121dc42ff5bc476afcaa44f3f6f Mon Sep 17 00:00:00 2001 From: JulianskyMe Date: Sat, 2 Nov 2024 23:26:32 +0200 Subject: [PATCH 1/2] Solution --- app/main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index 37b9f338..e613d444 100644 --- a/app/main.py +++ b/app/main.py @@ -1,3 +1,2 @@ def count_occurrences(phrase: str, letter: str) -> int: - # write your code here - pass + return phrase.lower().count(letter.lower()) From a4358af5abf71f65168d11f10c29b86fdbb1ccc7 Mon Sep 17 00:00:00 2001 From: JulianskyMe Date: Sat, 2 Nov 2024 23:33:58 +0200 Subject: [PATCH 2/2] Solution #2 --- app/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index e613d444..b90a1a94 100644 --- a/app/main.py +++ b/app/main.py @@ -1,2 +1,3 @@ def count_occurrences(phrase: str, letter: str) -> int: - return phrase.lower().count(letter.lower()) + count = phrase.lower().count(letter.lower()) + return count