input: def generate_html_table_for_bestselling_books(genre: str, top_n: int = 10) -> str:
      """
      Generates an HTML table displaying information about the top N bestselling books in a specific genre.
      The function connects to a SQLite database, retrieves the data, and constructs an HTML table.
      
      >>> print(generate_html_table_for_bestselling_books('Fantasy'))
      <table><tr><th>Title</th><th>Author</th><th>Genre</th><th>Sales</th></tr><tr><td>Book Title 1</td><td>Author Name 1</td><td>Fantasy</td><td>1000</td></tr><tr><td>Book Title 2</td><td>Author Name 2</td><td>Fantasy</td><td>900</td></tr></table>
      """
      import sqlite3
  
      # connect to the database
      conn = sqlite3.connect('books.db')
      c = conn.cursor()
  
      # retrieve the data
      c.execute(f'''SELECT title, author, genre, sales
      FROM Books
      WHERE genre=?
      ORDER BY sales DESC
      LIMIT ?''', (genre, top_n))
  
      # 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>'
      return html
output:     # close the database connection
      conn.close()