Need to check why the below code returns an error for a single placeholder whose value is populated via a list; however looping through a dict with two placeholders works fine. I have gone through seemingly similar questions but this seems to be a different scenario. Error reads: cur.execute('''INSERT OR IGNORE INTO Vip_type VALUES (?,)''', (item,)) sqlite3.OperationalError: near ")": syntax error
import sqlite3
conn = sqlite3.connect('vip.sqlite')
cur = conn.cursor()
v_lst = ['v1', 'v2', 'v3', 'v4']
for item in v_lst:
cur.execute('''INSERT OR IGNORE INTO Vip_type VALUES (?,)''', (item,))
conn.commit()
cur.close()
conn.close()