测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

PROBLEM SET

题库

按难度与知识点筛选,找到适合的练习题。

共 67434 题
重置

题目列表

共 67434 题
A37292 有如下 Python程序段:n=4a=[[i*n+j+1 for j in range(n)]for i in range(n)]for i in range(n//2): for j in range(1,n,2): a[i][j],a[n-i-1][n-j-1]=a[n-i-1][n-j-1],a[i][j]则程序执行后, a[1][1]和 a[2][0]的值分别是? ( ) 电子学会-Python-L6 -- 困难 -- A37293 小李设计一个显示加、 减、 乘、 除的单选框界面, 代码如下:import tkinterfrom tkinter import *root = Tk()v = IntVar()calcs = [ ('+', 1), ('-', 2), ("*", 3), ("/", 4),]for calc, num in calcs: # 设置单选框, 用来显示运算符 Radiobutton(text = … 电子学会-Python-L6 -- 困难 -- A37294 小萌要用 tkinter 制作一个单击按钮, 输出“Hello World!”的打招呼程序, 语句如下:import tkinter as tkwindow = tk.Tk()window.title("Python GUI") # ①window.geometry("600x100")window.mainloop()程序中①处语句的功能是? ( ) 电子学会-Python-L6 -- 困难 -- A37295 执行数据库操作的部分代码如下:import sqlite3db = sqlite3.connect("test.db")cur=db.cursor()cur.execute("create table Student(Sname char(20),Sage SMALLINT);")db.close()下列描述正确的是? ( ) 电子学会-Python-L6 -- 困难 -- A37296 commit() 函数是提交数据库操作的命令函数,下列不需要执行该函数的数据库操作的是?( ) 电子学会-Python-L6 -- 困难 -- A37298 有如下程序段:class Student: count = 0 def __init__(self, name): self.name = name Student.count += 1 def study(self): print(f'{self.name}在学习')student1 = Student("小明")student2 = Student("小红")student2.study()… 电子学会-Python-L6 -- 困难 -- A37299 下列关于类和对象的说法, 正确的是? ( ) 电子学会-Python-L6 -- 困难 -- A37300 绘制 sin(x)的图形如图所示,画线处的语句是? ( )import matplotlib.pyplot as pltimport numpy as npx = np.linspace(0, 10, 30)___________ 电子学会-Python-L6 -- 困难 -- A37301 关于 matplotlib 模块中函数的功能, 下列描述正确的是? ( ) 电子学会-Python-L6 -- 困难 -- A37302 有如下程序代码:import csv # ①headers = ['学号','姓名','分数']rows = [['202001','张三','98'],['202002','李四','95'],['202003','王五','92']]with open('score.csv','w',encoding='utf8',newline='') as f : # ② writer = csv.wr… 电子学会-Python-L6 -- 困难 -- A37303 文件“score.csv”中存放了3 位同学的成绩数据, 小李编写程序读取数据内容, 文件内容和程序成功读取界面如图所示。import csvcsv_reader = csv.reader(open(______))for row in csv_reader: print(______)上述程序中划线处应填入? ( ) 电子学会-Python-L6 -- 困难 -- A37304 小张近阶段要学习的英文单词存储在“data.txt”文件, 格式如图所示。处理“data.txt”文件中英文单词的 Python 程序段如下:file = open("data.txt")for word in file: if word[0:1] == "c": continue else: print(word)file.close()下列关于该程序段的功能,说法正确的是? ( ) 电子学会-Python-L6 -- 困难 -- A37305 明明每天坚持背英语单词, 他建立了英语单词错题本文件“mistakes. txt” , 将每天记错的单词增加到该文件中, 下列打开文件的语句最合适的是? ( ) 电子学会-Python-L6 -- 困难 -- A37306 输入数字1-7:如果输入1,输出星期一;如果输入2,输出星期二;……如果输入7,输出星期日;请按上述要求编写程序。 电子学会-C-L100 -- 较易 -- A37307 周末爸爸妈妈带着小马去动物园,门票的价格和游客的年龄有关系(关系如下展示),已知爸爸36岁,妈妈33岁,小马12岁,请问小马他们买门票花了多少钱(价格用price表示,年龄用age表示):#include <iostream>using namespace std;int main (){ int price; if (age>=18){ price=32; }else{ price=16; }… 电子学会-C-L100 -- 较易 -- A37308 执行下方程序,当输入85的时候,输出的结果是( )#include <iostream>using namespace std;int main (){ int score; cin >> score; if( score > 90 ){ cout << "优秀" << endl; }else{ cout << "良好" << endl; } return 0;} 电子学会-C-L100 -- 较易 -- A37309 执行下方程序,当输入90的时候,输出的结果是( )#include <iostream>using namespace std;int main (){ int score; cin >> score; if( score >= 90 ){ cout << "优秀" << endl; } if( a == 100 ){ cout << "完美" << endl; } if( a < 90 ){ … 电子学会-C-L100 -- 容易 -- A37310 执行下方程序,输出的结果是( )#include <iostream>using namespace std;int main (){ int a = 5; if( a < 20 ){ cout << "a 小于 20" << endl; } if( a < 10 ){ cout << "a 小于 10" << endl; } return 0;} 电子学会-C-L100 -- 容易 -- A37311 执行下方程序,输出的结果是( )#include <iostream>using namespace std;int main (){ int a = 10; if( a < 20 ){ cout << "a 小于 20" << endl; }else{ cout << "a 的值是 " << a << endl; } return 0;} 电子学会-C-L100 -- 容易 -- A37312 比较运算符是指两个数据之间的比较运算,下列哪个选项不属于比较运算符( )。 电子学会-C-L100 -- 容易 --