def transfer(conn, from_id, to_id, amount): conn.execute("UPDATE accounts SET balance = balance - ? WHERE id = ?", (amount, from_id)) conn.execute("UPDATE accounts SET balance = balance + ? WHERE id = ?", (amount, to_id)) conn.commit()