input: Write a Python function to detect and print links that contain specific words from a list using BeautifulSoup.
  ```python
  import requests
  from bs4 import BeautifulSoup
  
  def detect_links(url, words_to_detect):
      page = requests.get(url).text
      soup = BeautifulSoup(page, 'html.parser')
      links = soup.find_all('a')
      detected_links = []
      for link in links:
          for word in words_to_detect:
              if word in link.text:
                  detected_links.append(link['href'])
      return detected_links
  
  assert detect_links('https://example.com', ['green', 'blue']) == ['https://example.com/green', 'https://example.com/blue']
  assert detect_links('https://example.com', ['red']) == ['https://example.com/red']
  assert detect_links('https://example.com', ['yellow']) == []
output: for link in detected_links:
          print(link)