2020 现代礼仪(广州市公用事业技师学院) 最新满分章节测试答案
2020 工程招投标与合同管理(深圳大学) 最新满分章节测试答案
2020 工程预算(海南热带海洋学院) 最新满分章节测试答案
2020 税法(赣南师范大学) 最新满分章节测试答案
2020 快速成型技术_李伟(荆楚理工学院) 最新满分章节测试答案
2020 自动化工程开发python(新疆天山职业技术学院(本科)) 最新满分章节测试答案
本答案对应课程为:点我自动跳转查看
本课程起止时间为:2020-05-06到2020-06-30
本篇答案更新状态:已完结
项目1 爬取学生信息 测验1
1、 问题:class StudentDB: def openDB(self): self.con=sqlite3.connect(“students.db”) self.cursor=self.con.cursor() def closeDB(self): self.con.commit() self.con.close() def initTable(self): res={} try: self.cursor.execute(“create table students (No varchar(16) primary key,Name varchar(16), Sex varchar(8), Age int)”) res[“msg”]=”OK” except Exception as err: res[“msg”]=str(err) return res def updateRow(self,No,Name,Sex,Age): res={} try: _______ res[“msg”]=”OK” except Exception as err: res[“msg”]=str(err) return res程序修改一条学生记录,缺失的语句是
选项:
A:self.cursor.execute(“update students set Name=%s,Sex=%s,Age=%s where No=%s”,(Name,Sex,Age,No))
B:self.cursor.execute(“update students set Name=%s,Sex=%s,Age=%s where No=%d”,(Name,Sex,Age,No))
C:self.cursor.execute(“update students set Name=?,Sex=?,Age=? where No=?”,(Name,Sex,Age,No))
D:self.cursor.execute(“update students set Name=%,Sex=%,Age=% where No=%”,(Name,Sex,Age,No))
答案: 【self.cursor.execute(“update students set Name=?,Sex=?,Age=? where No=?”,(Name,Sex,Age,No))】 点我阅读全文