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".
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…