In my code:
>> s = 'abacaba'
>> s.count('aba')
>> 2
For the above code I am getting the correct answer as 'aba' occurs 2 times in the string s
.
But for the following case:
>> s = 'www'
>> s.count('ww')
>> 1
In this case I am expecting that s.count('ww')
will return 2
. But it returns 1
.
Why?