为什么这个 sqlite 查询中的变量后面有一个逗号?

Why is there a comma after the variable in this sqlite query?

我有以下代码并且可以运行,但我需要了解为什么变量 id_to_remove 后有一个逗号,有人可以向我解释为什么必须在那里吗? (不明白的部分加粗了)

def delete_user(id_to_remove):
    sql = "DELETE FROM USERS WHERE ID = ?"
    conn = create_connection()
    cursor = conn.cursor()
    **cursor.execute(sql, (id_to_remove, ))**
    conn.commit()
    conn.close()

所以我不知道为什么它是 id_to_remove,而不仅仅是 cursor.execute(sql,(id_to_remove))

因为它会将所有 ? 值替换为 tuple 中的值。如果不加逗号就是单值,需要加上逗号才构成单值tuple.