Qed jitgħabba l-eżerċizzju…
Given a string s and a character ch, count how many times that character appears in the string. This is useful when analyzing text, finding frequent letters, or checking user input. Return the number of matches.
"banana", "a"3"hello", "z"0"aaa", "a"3def count_char(s: str, ch: str) -> int:
Idħol biex tara l-istorja tas-sottomissjonijiet
IdħolIdħol biex tuża l-Mentor tal-AI
Idħol"banana", "a"3"hello", "z"0"aaa", "a"3"banana", "A"0"banana", "Hello, World!"0"aaa", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"0