MOOC全集答案标签存档订阅
2018 思想道德修养与法律基础(18畜牧兽医3、18畜牧兽医4)(江苏农林职业技术学院) 最新满分章节测试答案
2020 电子设计自动化(青岛理工大学琴岛学院) 最新满分章节测试答案
2021 经济学基础(郑州财税金融职业学院)1464968444 最新满分章节测试答案
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))】 点我阅读全文