input: Write a Python function to sort a list of strings by their lengths using lambda function.
  assert sort_by_length(['NumPy', 'SciPy', 'Pandas'])==['SciPy', 'NumPy', 'Pandas']
  assert sort_by_length(['apple', 'banana', 'cherry', 'date'])==['date', 'apple', 'banana', 'cherry']
  assert sort_by_length(['a', 'ab', 'abc', 'abcd'])==['a', 'ab', 'abc', 'abcd']
output: def sort_by_length(strings):
      return sorted(strings, key=lambda s: len(s))