import sqlite3 c = sqlite3.connect('history.db') for u in ['123','456','789']: c.execute("INSERT OR REPLACE INTO agents(username,password,name) VALUES(?,?,?)", (u,'123',u)) c.commit() print("ok")