青少年软件编程(python六级)等级考试试卷-客观题(2024年3月)
class test1:
def prt(self):
……
class Mg():
def__init__(na,ag):
self.na=na
class A():
def print(self):
print("Yes")
a=A()
a. print()
class 3Point:
def__init__(self):
……
import matplotlib.pyplot as plt
plt.plot([1,2,3,4,5])
plt.show()
import numpy as np
import matplotlib.pyplot as plt
plt.plot(np.array(1,5))
plt.show()
import matplotlib.pyplot as plt
plt.bar([1,2,3,4,5])
plt.show()
import matplotlib.pyplot as plt
plt.scatter([1,2,3,4,5])
plt.show()
import numpy as np
arr=np.array([[1,2,3,4],[5,6,7,8],[9,10,11,12]])
np.sum(arr[arr%2==0])
import numpy as np
arr=np.array([[1,2,3,4],[5,6,7,8],[9,10,11,12]])
np.sum(arr[:,arr%2==0])
import numpy as np
arr=np.array([[1,2,3,4],[5,6,7,8],[9,10,11,12]])
np.sum(arr[np.get(arr%2==0)])
import numpy as np
arr=np.array([[1,2,3,4],[5,6,7,8],[9,10,11,12]])
np.sum(arr[arr.even()])
plt.title()和 plt.legend()
plt.set_xlabel()和 plt.set_ylabel()
plt.xlabel()和 plt.ylabel()
plt.xticks()和 plt.yticks()
bar()函数用于绘制垂直柱形图
plot()函数用于绘制线形图
barh()函数用于绘制饼形图
scatter()函数用于绘制散点图
{'name':'Alice','age':25,'city':'New York'}
{'name':'Alice','age':25,'city':'New York'}
{"name":"Alice",age:25,city:'New York'}
{"name":"Alice","age":25,"city":"New York"}
一维数据可由列表表示,也可用集合表示
二维数据由多个一维数据构成
二维数据可由二维列表表达,也可由表格或 csv 格式的文件表达
一维数据采用线性方式组织,是有序的
{"name":"Alice","age":25,"city":"New York"}
{'name':'Alice','age':25,'city':'New York'}
[{'name':'Alice','age':25,'city':'New York'}]
['name':'Alice','age':25,'city':'New York']
["name":"Alice","age":25,"city":"New York"]
{'name':"Alice",'age':25,'city':"New York"}
{"name":"Alice","age":25,"city":"New York"}
{'name':'Alice','age':25,'city':'New York'}
是一种数据交换格式
是一种编程语言
是一种数据库
是一种算法
btn1.pack(side=TOP)
btn1.pack()
btn1.pack(side=BOTTOM)
btn1.pack(side='')
btn1.bind()
btn1.bind('',changebg)
btn1.bind('',changebg1)
btn1.bind('',changebg1)
from tkinter import*
root=Tk()
root.title("test")
e1=Entry(root)
e1.pack()
root.mainloop()
from tkinter import*
root=Tk()
root.title("test")
e1=Button(root)
e1.pack()
root.mainloop()
from tkinter import*
root=Tk()
root.title("test")
e1=Label(root,text='123')
e1.pack()
root.mainloop()
from tkinter import*
root=Tk()
root.title("test")
e1=Checkbutton(root,text='123')
e1.pack()
mainloop()
'connection=sqlite3.connection("mydatabase.db")'
'connection=sqlite3.connect("mydatabase.db")'
'connection=sqlite3.open("mydatabase.db")'
'connection=sqlite3.connect("mydatabase.txt")'
f=open("d:\\\\myfile.txt")
f=open("d:\\\\myfile.txt","rt ")
f=open("d:\\\\myfile.txt","rt ")
f=open("d:\\\\myfile.txt","rt ")
timu.docx
timu.docx
timu.txt
timu.jpg
2,0
2,1
2,2
0,2
发表评论 取消回复