From 7c1e60ae66593d45ae3d9d90e322ac3504f337fe Mon Sep 17 00:00:00 2001 From: Aidan Baird <102356055+AidanBaird@users.noreply.github.com> Date: Wed, 15 Jun 2022 23:51:54 +0100 Subject: [PATCH] Add files via upload --- All_star_code_challenges_18_kyu8.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 All_star_code_challenges_18_kyu8.py diff --git a/All_star_code_challenges_18_kyu8.py b/All_star_code_challenges_18_kyu8.py new file mode 100644 index 0000000..641b83b --- /dev/null +++ b/All_star_code_challenges_18_kyu8.py @@ -0,0 +1,8 @@ +# For loop to go through the letters whilst an if loop adds to the count if the letter is the specifies code letter + +def str_count(strng, letter): + count = 0 + for let in strng: + if let == letter: + count += 1 + return count \ No newline at end of file