input: Write a function to return a list of words that appear at least n times in the given list of words.
  assert frequent_words(['a', 'b', 'a', 'c', 'd', 'a', 'x', 'd', 'd'], 3)==['a', 'd']
  assert frequent_words(['a', 'b', 'a', 'c', 'd'], 2)==['a']
  assert frequent_words(['x', 'y', 'z', 'x', 'z'], 2)==['x', 'z']
  assert frequent_words(['a', 'a', 'a', 'a'], 4)==['a']
  assert frequent_words(['b', 'c', 'd', 'e'], 1)==['b', 'c', 'd', 'e']
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]