Computers and Technology

import sqlite3 from contextlib import closing conn = sqlite3.connect("books. sqlite") conn. row_factory = sqlite3.Row with closing(conn. cursor()) as c: query = '''SELECT * FROM Book WHERE pages > ?''' c. execute(query, (100,)) books = c. fetchall() for book in books: print(book["name"], "|", book["author"], "|", book["pages"]) name = "The Case of the Killer Kangaroo" author = "Jane Doe" pages = 408 genreID = 1 with closing(conn. cursor()) as c: query = '''INSERT INTO Book (name, author, pages, genreID) VALUES (?, ?, ?, ?)''' c. execute(query, (name, author, pages, genreID)) connmit() print(name, "inserted.") author = "Katie Kanga" with closing(conn. cursor()) as c: query = '''UPDATE Book SET author = ? WHERE name = ?''' c. execute(query, (author, name)) connmit() print(name, "updated.")

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 23:00, fluffy374747
The animal classthis class represents a an animal residing at a zoo. it has a weight (in pounds),height (in inches), a name, and a color. the methods in the class include constructors, getters, and a tostring. you will finish the implementation of these methods. referto the code documentation.1.getters: you will need to implement getter methods. these get a value (froma member variable) in the animal class. you will make a getter method toreturn each variable (weight, height, name, color). reference getname if youare having issues.2.tostring: you will need to finish the tostring method. this returns a stringcontaining information about an animal. the output string should be of theformat: ” (name) , a ( color )â’colored animal . ( weight ) pounds , ( height ) inches .\n”the height and weight are formatted to 1 decimal place. recall from lab 1how to format strings neatly using string. see the reference sectionfor more about string. format.
Answers: 2
image
Computers and Technology, 22.06.2019 07:30, DivineMemes420
What type of computer network ensures high security ?
Answers: 1
image
Computers and Technology, 23.06.2019 16:00, AM28
Does read theory have answers keys ?
Answers: 1
image
Computers and Technology, 23.06.2019 19:30, carcon2019
Amitha writes up a one-page summary of a novel during her summer internship at a publishing company. when she reads over the page, she realizes she used the word “foreshadow” seven times, and she would like to reduce the repetition. which tool would best amitha solve this problem?
Answers: 3
Do you know the correct answer?
import sqlite3 from contextlib import closing conn = sqlite3.connect("books. sqlite") conn. row_fact...

Questions in other subjects:

Konu
Mathematics, 16.10.2019 10:30