[Solved] counting word instances in a string


“i” is a variable used to keep track of what iteration you are on for the loop. “i” starts at 1 and each iteration is incremented by 1.

The “s[i:i+3]” means “the values in s from the character at ‘i’ to the character at ‘i+3′”.

2

solved counting word instances in a string