input: Write a python function to count the occurrences of each word in a list of words.
  assert word_counts(['apple', 'banana', 'apple', 'orange', 'banana', 'apple']) == {'apple': 3, 'banana': 2, 'orange': 1}
  assert word_counts(['hello', 'world', 'hello', 'hello', 'test', 'world']) == {'hello': 3, 'world': 2, 'test': 1}
  assert word_counts(['one', 'two', 'three', 'two', 'three', 'three']) == {'one': 1, 'two': 2, 'three': 3}
output: def word_counts(words):
      counts = {}
      for word in words:
          if word in counts:
              counts[word] += 1
          else:
              counts[word] = 1
      return counts