count_hi¶
Requirements:
substrings and slicing
loop through a string (while)
loop with an accumulator variable
Return the number of times that the string “hi” appears anywhere in the given string.
This exercise was taken from codingbat.com and has been adapted for the Python language. There are many great programming exercises there, but the majority are created for Java.