input: Write a function to sort a list of strings by their length. If two strings have the same length, their relative order should remain unchanged. The function should return the sorted list.
  assert sort_by_length(["cat", "dog", "apple", "banana"]) == ["cat", "dog", "apple", "banana"]
  assert sort_by_length(["apple", "ban", "pear", "kiwi"]) == ["ban", "pear", "kiwi", "apple"]
  assert sort_by_length([]) == []
  assert sort_by_length(["a", "bb", "ccc", "dddd"]) == ["a", "bb", "ccc", "dddd"]
  assert sort_by_length(["hello", "hi", "hey"]) == ["hi", "hey", "hello"]
output: def sort_by_length(strings):
      return sorted(strings, key=len)