input: from collections import Counter
  
  
  def frequent_words(words: list[str], n: int) -> list[str]:
      """
      Takes a list of words and an integer n, returns a list of words that appear at least n times in the given list.
  
      >>> frequent_words(['a', 'b', 'a', 'c', 'd', 'a', 'x', 'd', 'd'], 3)
      ['a', 'd']
      >>> frequent_words(['python', 'is', 'fun', 'python', 'is', 'cool'], 2)
      ['python', 'is']
      """
      counts = Counter(words)
      return [word for word, count in counts.items() if count >= n]
output:     counts = Counter(words)
      return [word for word, count in counts.items() if count >= n]