input: Write a function to generate an HTML table displaying information about the top 10 bestselling books in a specific genre. The function should connect to a SQLite database, retrieve the data from the Books table, and generate the HTML code for the table. The function should return the generated HTML as a string.
  
  def generate_bestselling_books_table(genre: str, db_path: str) -> str:
   conn = sqlite3.connect(db_path)
   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>'
   
   return html
  
  assert generate_bestselling_books_table('Fantasy', 'books.db') == '<table><tr><th>Title</th><th>Author</th><th>Genre</th><th>Sales</th></tr><tr><td>The Hobbit</td><td>J.R.R. Tolkien</td><td>Fantasy</td><td>1000000</td></tr><tr><td>Harry Potter and the Sorcerer's Stone</td><td>J.K. Rowling</td><td>Fantasy</td><td>800000</td></tr></table>'
  assert generate_bestselling_books_table('Science Fiction', 'books.db') == '<table><tr><th>Title</th><th>Author</th><th>Genre</th><th>Sales</th></tr><tr><td>Dune</td><td>Frank Herbert</td><td>Science Fiction</td><td>750000</td></tr></table>'
  assert generate_bestselling_books_table('Mystery', 'books.db') == '<table><tr><th>Title</th><th>Author</th><th>Genre</th><th>Sales</th></tr></table>'
  assert generate_bestselling_books_table('', 'books.db') == '<table><tr><th>Title</th><th>Author</th><th>Genre</th><th>Sales</th></tr></table>'
output: 
  def generate_bestselling_books_table(genre: str, db_path: str) -> str:
   conn = sqlite3.connect(db_path)
   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>'
   
   return html
  