input: Write a python function to sort a list of words by their length.
  assert sort_by_length(["apple", "banana", "cherry", "date"]) == ["date", "apple", "cherry", "banana"]
  assert sort_by_length(["elephant", "dog", "cat", "mouse"]) == ["dog", "cat", "mouse", "elephant"]
  assert sort_by_length(["word", "words", "wordy", "wordier"]) == ["word", "words", "wordy", "wordier"]
output: def sort_by_length(words):
      return sorted(words, key=len)