input: Write a python function to generate all possible substrings of a given string.
  assert substrings("python") == ['p', 'py', 'pyt', 'pyth', 'pytho', 'python', 'y', 'yt', 'yth', 'ytho', 'ython', 't', 'th', 'tho', 'thon', 'h', 'ho', 'hon', 'o', 'on', 'n']
  assert substrings("abc") == ['a', 'ab', 'abc', 'b', 'bc', 'c']
  assert substrings("") == []
output: def substrings(s):
      result = []
      for i in range(len(s)):
          for j in range(i + 1, len(s) + 1):
              result.append(s[i:j])
      return result