input: Write a function to create a Python program that takes in two strings and returns an integer indicating the number of common substrings between the two strings.
  def num_common_substrings(s1, s2):
      count = 0
      for i in range(len(s1)):
          for j in range(len(s2)):
              if s1[i] == s2[j]:
                  count += 1
      return count
  
  assert num_common_substrings("abcd", "bae") == 2
  assert num_common_substrings("xy", "zy") == 1
  assert num_common_substrings("abc", "def") == 0
  assert num_common_substrings("", "") == 0
  assert num_common_substrings("aaaa", "aaaa") == 4
output: def num_common_substrings(s1, s2):
      count = 0
      for i in range(len(s1)):
          for j in range(len(s2)):
              if s1[i] == s2[j]:
                  count += 1
      return count