input: Write a function to generate an HTML table displaying information about the top 10 bestselling books in a specific genre from a given SQLite database. The function should accept the name of the table, the column names, and the genre as arguments. It should return a string containing the HTML code for the table. If no books are found for the specified genre, it should return an empty string.
  assert generate_html_table('books', ['id', 'title', 'author', 'genre', 'sales'], 'Fantasy')=='<table><tr><th>Title</th><th>Author</th><th>Genre</th><th>Sales</th></tr><tr><td>Book1</td><td>Author1</td><td>Fantasy</td><td>1000</td></tr><tr><td>Book2</td><td>Author2</td><td>Fantasy</td><td>900</td></tr></table>'
  assert generate_html_table('books', ['id', 'title', 'author', 'genre', 'sales'], 'Mystery')==''
  assert generate_html_table('books', ['id', 'title', 'author', 'genre', 'sales'], 'Sci-Fi')=='<table><tr><th>Title</th><th>Author</th><th>Genre</th><th>Sales</th></tr><tr><td>Book3</td><td>Author3</td><td>Sci-Fi</td><td>800</td></tr></table>'
  assert generate_html_table('books', ['id', 'title', 'author', 'genre', 'sales'], 'Non-Fiction')==''
  assert generate_html_table('books', ['id', 'title', 'author', 'genre', 'sales'], '')==''
output: def generate_html_table(table_name, columns, genre):
      import sqlite3
      conn = sqlite3.connect('database.db')
      cursor = conn.cursor()
      cursor.execute(f"SELECT {', '.join(columns)} FROM {table_name} WHERE genre=? ORDER BY sales DESC LIMIT 10", (genre,))
      rows = cursor.fetchall()
      conn.close()
      
      if not rows:
          return ''
      
      header = ''.join(f'<th>{col.capitalize()}</th>' for col in columns if col != 'id')
      rows_html = ''.join(f'<tr>{"".join(f"<td>{row[i]}</td>" for i, col in enumerate(columns) if col != 'id')}</tr>' for row in rows)
      
      return f'<table><tr>{header}</tr>{rows_html}</table>'