input: Write a function to sort a list of strings by their length. The function should return a new list where the strings are arranged from shortest to longest. If the input list is empty, the function should return an empty list.
  
  assert sort_by_length(["cat", "dog", "apple", "banana"]) == ["cat", "dog", "apple", "banana"]
  assert sort_by_length([]) == []
output: def sort_by_length(strings):
      return sorted(strings, key=len)