input: Write a function to sort a list of strings by their length. The function should take a list of strings as input and return a new list of strings sorted in ascending order based on their lengths. 
  assert sort_by_length(["cat", "dog", "apple", "banana"])==["cat", "dog", "apple", "banana"]
  assert sort_by_length(["hello", "world", "a", "is"])==["a", "is", "hello", "world"]
  assert sort_by_length(["programming", "is", "fun"])==["is", "fun", "programming"]
  assert sort_by_length([])==[]
  assert sort_by_length(["one"])==["one"]
output: def sort_by_length(strings):
      return sorted(strings, key=len)