input: Write a python function to sort a list of strings by their lengths.
  assert sort_by_length(['apple', 'banana', 'cherry', 'date']) == ['date', 'apple', 'banana', 'cherry']
  assert sort_by_length(['a', 'abc', 'ab']) == ['a', 'ab', 'abc']
  assert sort_by_length(['hello', 'world', 'python', 'is', 'awesome']) == ['is', 'hello', 'world', 'python', 'awesome']
output: def sort_by_length(strings):
      return sorted(strings, key=len)