input: Write a function to sort a list of strings by their length in ascending order using a sorting algorithm in Python.
  
  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
  
  assert sort_by_length(["cat", "dog", "apple", "banana"])==["cat", "dog", "apple", "banana"]
  assert sort_by_length(["python", "java", "c", "javascript"])==["c", "java", "python", "javascript"]
  assert sort_by_length(["hello", "world", "artificial", "intelligence"])==["hello", "world", "a", "b"]
  assert sort_by_length(["short", "longer", "longest", "medium"])==["short", "medium", "longer", "longest"]
  assert sort_by_length([])==[]
output: 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