input: Write a python function to count the number of times a substring T appears in string S.
  assert count_substring("ababcab", "ab") == 2
  assert count_substring("aaaaa", "aa") == 4
  assert count_substring("hello world", "world") == 1
output: def count_substring(S, T):
      count = 0
      start = 0
      while start <= len(S) - len(T):
          pos = S.find(T, start)
          if pos == -1:
              break
          count += 1
          start = pos + 1
      return count