input: Write a function that takes a list of strings as input and sorts them based on their length. The function should return the sorted list. If the input list is empty, the function should return an empty list.
  
  assert sort_by_length(["Hello","World!","Good","Morning"])==["Good", "Hello", "Morning", "World!"]
  assert sort_by_length([])==[]
  assert sort_by_length(["a", "bb", "ccc", "dddd"])==["a", "bb", "ccc", "dddd"]
output: def sort_by_length(strings):
      return sorted(strings, key=len)