input: Write a function to create a web scraper that extracts specific data from a given website using the Python package BeautifulSoup. The function should take a URL and a list of HTML tags that contain the data to be extracted. It should return a list of the extracted data.
  
  assert scrape_data("<url_of_webpage>", ['a'])==['http://example.com', 'http://another-example.com']
  assert scrape_data("<url_of_another_webpage>", ['h1'])==['Main Heading', 'Sub Heading']
  assert scrape_data("<url_of_a_third_webpage>", [])==[]
  assert scrape_data("<url_of_a_fourth_webpage>", ['button', 'a'])==['Button Text', 'http://link-example.com']
output: def scrape_data(url, tags):
      from bs4 import BeautifulSoup
      import requests
      response = requests.get(url)
      soup = BeautifulSoup(response.text, 'html.parser')
      data = []
      for tag in tags:
          elements = soup.find_all(tag)
          for element in elements:
              if element.string:
                  data.append(element.string.strip())
              elif element.get('href'):
                  data.append(element.get('href'))
      return data