Question: Return True if the string cat and dog appear the same number of times in the given string. You may not use any built in
Return True if the string "cat" and "dog" appear the same number of times in the given string. You may not use any built in Python string functions, except for len(). Complete the exercise using a For Loop and a While Loop.
Example: cat_dog('catdog') True
cat_dog('catcat') False
def cat_dog_while(str):
#missing code
def cat_dog_for(str):
missing code
Help me with my python! Thank you so much :)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
