I have selected_comments which is a tuple of id that I want to remove from the sqlite3 database. I tried this command (and other variations):
cursor.execute("DELETE FROM comments WHERE id IN (?)",(selected_comments))
But I get errors (for this specific command, I have: sqlite3.ProgrammingError: Incorrect number of bindings supplied.).
The size of the tuple is not fixed: it can go from 1 element to as much as you want.
selected_commentsand not(selected_comments)??as well.(selected_comments,)instead of(selected_comments).selected_commentsis already a tuple, so there is no need to add the comma.