input: Write a function to return a list of words that appear at least n times in the given list.
  assert frequent_words(['a', 'b', 'a', 'c', 'd', 'a', 'x', 'd', 'd'], 3) == ['a', 'd']
  assert frequent_words(['x', 'y', 'z', 'x', 'x', 'z'], 2) == ['x', 'z']
  assert frequent_words(['one', 'two', 'one', 'three'], 1) == ['one', 'two', 'three']
  assert frequent_words([], 1) == []
  assert frequent_words(['a', 'b', 'c'], 2) == []
output: def frequent_words(words, n):
      word_count = {}
      for word in words:
          if word in word_count:
              word_count[word] += 1
          else:
              word_count[word] = 1
      result = [word for word, count in word_count.items() if count >= n]
      return result