input: Write a function to generate an HTML table displaying information about the top 10 bestselling books in a specific genre from a given database. The function should connect to the database, retrieve the data, and generate the HTML table. The output should be printed as a string. The database table named "Books" contains the following columns: id (int), title (string), author (string), genre (string), sales (int).
  
  
  import sqlite3
  
  def generate_html_table(genre):
      # connect to the database
      conn = sqlite3.connect('books.db')
      c = conn.cursor()
  
      # retrieve the data
      c.execute('''SELECT title, author, genre, sales
      FROM Books
      WHERE genre=?
      ORDER BY sales DESC
      LIMIT 10''', (genre,))
  
      # save the results
      results = c.fetchall()
  
      # generate the HTML code
      html = '<table>'
      html += '<tr><th>Title</th><th>Author</th><th>Genre</th><th>Sales</th></tr>'
  
      for result in results:
          title = result[0]
          author = result[1]
          genre = result[2]
          sales = result[3]
  
          html += f'<tr><td>{title}</td><td>{author}</td><td>{genre}</td><td>{sales}</td></tr>'
  
      html += '</table>'
  
      # display the results
      print(html)
  
  assert generate_html_table('Fantasy') == '<table><tr><th>Title</th><th>Author</th><th>Genre</th><th>Sales</th></tr><tr><td>Example Title 1</td><td>Example Author 1</td><td>Fantasy</td><td>1000</td></tr><tr><td>Example Title 2</td><td>Example Author 2</td><td>Fantasy</td><td>900</td></tr></table>'
  assert generate_html_table('Sci-Fi') == '<table><tr><th>Title</th><th>Author</th><th>Genre</th><th>Sales</th></tr><tr><td>Sci-Fi Title 1</td><td>Sci-Fi Author 1</td><td>Sci-Fi</td><td>800</td></tr><tr><td>Sci-Fi Title 2</td><td>Sci-Fi Author 2</td><td>Sci-Fi</td><td>700</td></tr></table>'
  assert generate_html_table('Horror') == '<table><tr><th>Title</th><th>Author</th><th>Genre</th><th>Sales</th></tr><tr><td>Horror Title 1</td><td>Horror Author 1</td><td>Horror</td><td>600</td></tr><tr><td>Horror Title 2</td><td>Horror Author 2</td><td>Horror</td><td>500</td></tr></table>'
output: def generate_html_table(genre):
      conn = sqlite3.connect('books.db')
      c = conn.cursor()
      c.execute('''SELECT title, author, genre, sales
      FROM Books
      WHERE genre=?
      ORDER BY sales DESC
      LIMIT 10''', (genre,))
      results = c.fetchall()
      html = '<table>'
      html += '<tr><th>Title</th><th>Author</th><th>Genre</th><th>Sales</th></tr>'
      for result in results:
          title = result[0]
          author = result[1]
          genre = result[2]
          sales = result[3]
          html += f'<tr><td>{title}</td><td>{author}</td><td>{genre}</td><td>{sales}</td></tr>'
      html += '</table>'
      print(html)