input: Write a function to sort a list of strings by their lengths.
  assert sortByLength(['cat', 'dog', 'goat', 'tiger', 'bird']) == ['cat', 'dog', 'goat', 'bird', 'tiger']
  assert sortByLength(['apple', 'fig', 'banana', 'kiwi']) == ['fig', 'kiwi', 'apple', 'banana']
  assert sortByLength(['a', 'ab', 'abc', 'abcd']) == ['a', 'ab', 'abc', 'abcd']
output: def sortByLength(strings):
      return sorted(strings, key=len)