Run ❯
Get your
own Python
server
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Change Language
Go to Spaces
Ctrl+Alt+P
import sqlite3 con = sqlite3.connect(":memory:") cur = con.cursor() # The database is in memory, so it is # empty every time the program starts. # Create the table: cur.execute(""" CREATE TABLE players ( id INTEGER PRIMARY KEY, name TEXT, score INTEGER ) """) sql = """ INSERT INTO players (name, score) VALUES (?, ?) """ cur.execute(sql, ("Emil", 120)) print(cur.lastrowid) cur.execute(sql, ("Tobias", 95)) print(cur.lastrowid) con.commit()
1
2