From 5a8417d353c7000b7853d5fb9ac64ebf76997165 Mon Sep 17 00:00:00 2001 From: Anastasiia Date: Fri, 25 Oct 2024 18:50:16 +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 f28d1db73038cdd7e6275e6e7906db896848ae64 Mon Sep 17 00:00:00 2001 From: Anastasiia Date: Fri, 25 Oct 2024 19:11:49 +0200 Subject: [PATCH 2/2] Fix solution --- app/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index e613d444..d0ccb982 100644 --- a/app/main.py +++ b/app/main.py @@ -1,2 +1,2 @@ def count_occurrences(phrase: str, letter: str) -> int: - return phrase.lower().count(letter.lower()) + return int(phrase.lower().count(letter.lower()))