input: Write a python function to extract the content of the table and return it as a list of dictionaries where each dictionary represents a row with keys 'Language', 'Feature', and 'Benefit'.
  assert extract_table_data('<html><head><title>Programming Languages Features and Benefits</title></head><body><table><tr><th>Language</th><th>Feature</th><th>Benefit</th></tr><tr><td>Python</td><td>Strong support for object-oriented programming </td><td>Allows for more efficient and organized programming </td></tr><tr><td>C++</td><td>Ease of integration into other code</td><td>Reduces amount of code needed to add existing libraries </td></tr><tr><td>JavaScript</td><td> Third-party libraries available </td><td>Allows developers to access existing functions quickly without having to code them </td></tr><tr><td>C#</td><td>Multiple type systems available </td><td>Allows you to use the type system more suited to the tasks at hand </td></tr></table></body></html>') == [{'Language': 'Python', 'Feature': 'Strong support for object-oriented programming', 'Benefit': 'Allows for more efficient and organized programming'}, {'Language': 'C++', 'Feature': 'Ease of integration into other code', 'Benefit': 'Reduces amount of code needed to add existing libraries'}, {'Language': 'JavaScript', 'Feature': 'Third-party libraries available', 'Benefit': 'Allows developers to access existing functions quickly without having to code them'}, {'Language': 'C#', 'Feature': 'Multiple type systems available', 'Benefit': 'Allows you to use the type system more suited to the tasks at hand'}]
output: def extract_table_data(html):
      from bs4 import BeautifulSoup
      
      soup = BeautifulSoup(html, 'html.parser')
      table = soup.find('table')
      headers = [th.get_text(strip=True) for th in table.find_all('th')]
      rows = []
  
      for tr in table.find_all('tr')[1:]:
          cells = tr.find_all('td')
          row_data = {headers[i]: cells[i].get_text(strip=True) for i in range(len(headers))}
          rows.append(row_data)
  
      return rows