![](https://lstatic.shangxueba.com/jiandati/pc/images/pc_jdt_tittleico.png)
The students who respond to the survey are aged at______.
![](https://lstatic.shangxueba.com/jiandati/pc/images/jdt_panel_vip.png)
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 deleteRow(self,No): res={} try: ______________________________________________ res["msg"]="OK" except Exception as err: res["msg"]=str(err) return res 程序删除一条学生记录,缺失的语句是
A、self.cursor.execute("delete from students where No=?",(No))
B、self.cursor.execute("delete from students where No=?",(No,))
C、self.cursor.execute("delete from students where No=%s",(No,))
D、self.cursor.execute("delete from students where No=%s",(No))
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 selectRows(self): res={} try: data=[] __________________________________________________ __________________________________________________ for row in rows: d={} d["No"]=row[0] d["Name"]=row[1] d["Sex"]=row[2] d["Age"]=row[3] data.append(d) res["msg"]="OK" res["data"]=data except Exception as err: res["msg"]=str(err) return res 从数据库中读出所有学生记录,缺失的语句是
A、self.cursor.execute("select * from students order by No");rows=self.cursor.fetchall()
B、self.con.execute("select * from students order by No");rows=self.con.fetchall()
C、self.cursor.execute("select * from students order by No");rows=self.cursor.fetch()
D、self.con.execute("select * from students order by No");rows=self.con.fetch()
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))
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 insertRow(self,No,Name,Sex,Age): res={} try: ___________________________________________ res["msg"]="OK" except Exception as err: res["msg"]=str(err) return res 程序插入一条学生记录,缺失的语句是
A、self.cursor.execute("insert into students (No,Name,Sex,Age) values (%s,%s,%s,%s)",(No,Name,Sex,Age))
B、self.cursor.execute("insert into students (No,Name,Sex,Age) values (%s,%s,%s,%d)",(No,Name,Sex,Age))
C、self.cursor.execute("insert into students (No,Name,Sex,Age) values (@No,@Name,@Sex,@Age)",(No,Name,Sex,Age))
D、self.cursor.execute("insert into students (No,Name,Sex,Age) values (,?,?,?)",(No,Name,Sex,Age))
selector.xpah("//book/title") 搜索文档中所有 <book> 下一级的 <title>元素,找到2个,结果与selector.xpah("//title")、selector.xpath("//bookstore//title")一样;
参考答案:<span style="color:rgb(255, 0, 0)">正确</span>
17、selector.xpath("//book//price")与selector.xpath("//price")结果一样,都是找到2个<price>元素;
参考答案:<span style="color:rgb(255, 0, 0)">正确</span>
18、selector.xpath("/book//price")与selector.xpath("//price")结果一样;
参考答案:<span style="color:rgb(255, 0, 0)">错误</span>
19、selector.xpath("//book[id=’book1’]//price")与selector.xpath("//price")结果一样;
参考答案:<span style="color:rgb(255, 0, 0)">错误</span>
20、selector.xpath("//price/text()").extract()返回price下面的文本字符串
参考答案:<span style="color:rgb(255, 0, 0)">错误</span>
1、编写服务器程序server.py如下: import flask app=flask.Flask(__name__) @app.route("/") def index(): try: province=flask.request.args.get("province") city = flask.request.args.get("city") return province+","+city except Exception as err: return str(err) if __name__=="__main__": app.run() 编写客户端程序client.py如下: import urllib.parse import urllib.request url="http://127.0.0.1:5000" try: province= urllib.parse.quote("广东") city= urllib.parse.quote("深圳") data="province="+province+"&city="+city html=urllib.request.urlopen("http://127.0.0.1:5000?"+data) ____________________ html = html.decode() print(html) except Exception as err: print(err) 缺失的语句是
A、html=html.read()
B、html.read()
C、html=html.get()
D、html.get()
参考答案:<span style="color:rgb(255, 0, 0)">A</span>
2、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))
参考答案:<span style="color:rgb(255, 0, 0)">C</span>
3、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 insertRow(self,No,Name,Sex,Age): res={} try: ___________________________________________ res["msg"]="OK" except Exception as err: res["msg"]=str(err) return res 程序插入一条学生记录,缺失的语句是
A、self.cursor.execute("insert into students (No,Name,Sex,Age) values (%s,%s,%s,%s)",(No,Name,Sex,Age))
B、self.cursor.execute("insert into students (No,Name,Sex,Age) values (%s,%s,%s,%d)",(No,Name,Sex,Age))
C、self.cursor.execute("insert into students (No,Name,Sex,Age) values (@No,@Name,@Sex,@Age)",(No,Name,Sex,Age))
D、self.cursor.execute("insert into students (No,Name,Sex,Age) values (,?,?,?)",(No,Name,Sex,Age))
参考答案:<span style="color:rgb(255, 0, 0)">D</span>
4、服务器程序接受客户端上传的文件名称fileName,然后获取文件数据保存 import flask app=flask.Flask(__name__) @app.route("/upload",methods=["POST"]) def uploadFile(): msg="" try: if "fileName" in flask.request.values: fileName = flask.request.values.get("fileName") __________________________________ fobj=open("upload "+fileName,"wb") fobj.write(data) fobj.close() msg="OK" else: msg="没有按要求上传文件" except Exception as err: print(err) msg=str(err) return msg if __name__=="__main__": app.run()
A、data=flask.request.read()
B、data=flask.request.get_data()
C、data=flask.request.values.read()
D、data=flask.request.values.get_data()
参考答案:<span style="color:rgb(255, 0, 0)">B</span>
5、服务器程序可以接受get与post的提交信息 import flask app=flask.Flask(__name__) @app.route("/",____________________) def index(): try: province=flask.request.values.get("province") if "province" in flask.request.values else "" city = flask.request.values.get("city") if "city" in flask.request.values else "" note = flask.request.values.get("note") if "note" in flask.request.values else "" return province+","+city+"\n"+note except Exception as err: return str(err) if __name__=="__main__": app.run() 缺失的语句是
A、methods=["GET","POST"]
B、method=["GET","POST"]
C、methods=["POST"]
D、method=["POST"]
参考答案:<span style="color:rgb(255, 0, 0)">A</span>
6、from bs4 import BeautifulSoup doc=’’’ <html><head><title>The Dormouse’s story</title>
The Dormouse’s story
</head></html></price></title></book>
...
’’’ soup=BeautifulSoup(doc,"lxml") _______________________________ print(tag) 程序结果找到class="story"的
元素,缺失的语句是
A、tag=soup.find("p",attrs={"class":"story"})
B、tag=soup.find("p",attr={"class":"story"})
C、tag=soup.find("p")
D、tag=soup.find("p",class="story")
What was the motivation behind the tenure system?
A.To allow professors to pursue their research without outside influence.
B.To prevent academic positions from being used for research that is not useful.
C.To discipline professors who make claims that are not true.
D.To provide professors with a secure income so that they can focus on research.
Who should sign up?
A.Only students who have time for the work.
B.All the students who are at the meeting.
C.Only students who have a telephone.
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!