input: Write a function that takes a list of words and an integer n and returns 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(['apple', 'banana', 'apple', 'orange', 'banana'], 2) == ['apple', 'banana']
  assert frequent_words(['cat', 'dog', 'bird'], 2) == []
  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
      return [word for word in word_count if word_count[word] >= n]