QuestionQ4

VerifiedFile Processing and Communicating with a Program’s Environment

Which two statements about the sqlite3 module are true?

Choose two
Explanation

The Cursor class in the sqlite3 module defines the execute() method, which is used to run a single SQL statement (optionally with parameters) — running multiple statements at once requires executescript(), not execute(). Additionally, the fetchone() method advances the cursor and returns the next row of a query result, returning None once there are no more rows to fetch. In contrast, fetchall() returns a list of the remaining rows, giving an empty list (not None) when no rows remain.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!