importsqlite3# connect to the databaseconn=sqlite3.connect('mydatabase.db')conn.execute('''CREATE TABLE IF NOT EXISTS mytable
(id INTEGER PRIMARY KEY, name TEXT, age INTEGER)''')conn.execute("INSERT INTO mytable (name, age) VALUES ('Alice', 25)")# a cursor object is usedconn.commit()# save changes into db file