Skip to content
Advertisement

Check how many times a string appears in a particular word

I am practicing my python coding on this website. This is the problem

JavaScript

This is my code , for some unknown reason , i dont pass all the testcases. I have problems debugging it

JavaScript

Advertisement

Answer

You don’t need to creat a function,just a line is enough.like:

return s.count('cat') == s.count('dog')

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement