青少年软件编程(python六级)等级考试试卷-客观题(2023年12月)
cursor.execute('insert into user (id, name) values (\\'1\\', \\'张三\\')')
cursor.execute('update user set name = "吴吴" WHERE ID = 4')
cursor.execute('select id,name from user')
conn.execute("DELETE from user")
输出前两条记录
输出第2条记录
输出后两条记录
输出中间两条记录
commit()功能是提交当前的所有事务。如果没有提交,程序自上次提交后的所有操作是不可见的
execute()功能是执行SQL语句
fetchall()功能是获取查询结果中所有的记录,返回类型为列表
close()功能是关闭数据库连接,将自动调用commit()以保存所有更改
class Cat(Animal):
class Cat extends Animal:
class Cat inherits Animal:
class Cat is Animal:
25.12
50.24
没有输出
50.24
25.12
会报错
cat = Animal()
cat = Animal()
cat.color = "black"
cat.sound = "meow"
cat.color = "black"
cat.sound = "meow"
cat = Animal()
cat = new Animal()
cat.color = "black"
cat.sound = "meow"
f=open('a.txt','r')
f=open('a.txt','w')
f=open('a.txt','a')
f=open('a.txt','r ')
字符串
数组
元组
列表
[3 4]
[2 3]
[2 3 4]
[2 4]
3
4
6
10
显示一个子图,包含一个包含折线图的区域和一个包含散点图的区域
显示一个子图,包含一个包含折线图和散点图的混合图形
显示两个子图,分别包含折线图和散点图
不显示任何内容
显示一个简单的折线图
显示一个已经标注了标题、x轴和y轴标签的简单折线图
显示一个已经标注了 x 轴和 y 轴标签的简单折线图
不显示任何内容
100*200的矩形
300*300的矩形
100*100的矩形
200*100的矩形
button = tk.Label(root, text="Hello")
button = tk.Entry(root)
button = tk.Button(root, text="Click")
button = tk.Checkbutton(root, text="Check me")
`widget.bg_color = "red"`
`widget.background = "red"`
`widget.set_bg_color("red")`
`widget.config(bg="red")`
20,0,4
20,0,-4
0,20,4
0,20,-4
a.shape()
a.shape
a.ndim()
a.ndim
a[1][3]
a[2][3]
a[1][4]
a[2][4]
reader,writer
writer,reader
dump,load
load,dump
使用json.dumps()函数可以将Python对象转换为JSON字符串
使用json.write()函数可以将Python对象写入JSON文件
使用json.decode()函数可以将JSON字符串解码为Python对象
使用json.parse()函数可以将JSON字符串解析为Python对象
发表评论 取消回复