input: Write a function to take a list of words and an integer n, and return a list of words that appear at least n times in the given list. If the given list is empty then return an empty list.
  assert frequent_words(['a', 'b', 'a', 'c', 'd', 'a', 'x', 'd', 'd'], 3) == ['a', 'd']
  assert frequent_words(['x', 'y', 'x', 'z', 'y', 'y'], 2) == ['y', 'x']
  assert frequent_words(['a', 'b', 'c', 'd'], 1) == ['a', 'b', 'c', 'd']
  assert frequent_words(['a', 'a', 'a', 'a'], 4) == ['a']
  assert frequent_words([], 1) == []
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 in word_count if word_count[word] >= n]
      return result