input: def sort_by_length(strings):
      for i in range(len(strings) - 1):
          for j in range(i + 1, len(strings)):
              if len(strings[i]) > len(strings[j]):
                  strings[i], strings[j] = strings[j], strings[i]
      return strings
      
  """
  Sort a list of strings by their length using a simple bubble sort algorithm.
  >>> sort_by_length(["cat", "dog", "apple", "banana"])
  ['cat', 'dog', 'apple', 'banana']
  >>> sort_by_length(["hello", "world", "python", "sort"])
  ['sort', 'world', 'hello', 'python']
  """
output:     for i in range(len(strings) - 1):
          for j in range(i + 1, len(strings)):
              if len(strings[i]) > len(strings[j]):
                  strings[i], strings[j] = strings[j], strings[i]
      return strings