text = "This is the string with the word 'the' in it."

for i in range(len(text) - 1):
  if text[i:i+2] == "th":
    print("th") 