From 2eb35a8dfc47e265a48161f9dab9a550e3f468fe Mon Sep 17 00:00:00 2001 From: Hideous Date: Tue, 11 Nov 2025 22:41:11 +0200 Subject: [PATCH 1/2] Solution --- app/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index 37b9f338b..729fc27fd 100644 --- a/app/main.py +++ b/app/main.py @@ -1,3 +1,6 @@ def count_occurrences(phrase: str, letter: str) -> int: - # write your code here - pass + counter = 0 + for char in phrase: + if char.lower() == letter.lower(): + counter += 1 + return counter From 6e2de8d8e6e2245556531a07ca860409fe6d5752 Mon Sep 17 00:00:00 2001 From: Hideous Date: Tue, 11 Nov 2025 23:38:05 +0200 Subject: [PATCH 2/2] fix newline and character --- app/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index 729fc27fd..b06ac1452 100644 --- a/app/main.py +++ b/app/main.py @@ -1,6 +1,7 @@ def count_occurrences(phrase: str, letter: str) -> int: counter = 0 - for char in phrase: - if char.lower() == letter.lower(): + for character in phrase: + if character.lower() == letter.lower(): counter += 1 + return counter