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 list is empty return an empty list. If n is less than or equal to 0 return an empty list.
  assert frequent_words(['a', 'b', 'a', 'c', 'd', 'a', 'x', 'd', 'd'], 3)==['a', 'd']
  assert frequent_words(['cat', 'dog', 'cat', 'dog', 'dog'], 2)==['cat', 'dog']
  assert frequent_words(['cat', 'dog', 'cat', 'dog', 'dog'], 0)==[]
  assert frequent_words([], 3)==[]
  assert frequent_words(['a', 'a', 'a', 'b'], -1)==[]
  assert frequent_words(['a', 'a', 'a', 'b'], 4)==['a']
output: def frequent_words(words, n):
      if n <= 0 or not words:
          return []
      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]