Read the docs:
Return the number of (non-overlapping) occurrences of substring sub in string
s[start:end]
. Defaults for start and end and interpretation of negative values are the same as for slices.
Since “ww” is first matched, it proceeds from the third “w” and fails to match “ww”.