PROBLEM SET
题库
按难度与知识点筛选,找到适合的练习题。
题目列表
共 67434 题
A17951
已知字典 info = {'name': '小明', 'age': 12},执行 info['grade'] = 5 后,字典 info 为?( )
电子学会-Python-L5
困难
--
A17952
将某次比赛最后得分用字典存储:dict={"第1名":50,"第2名":48,"第3名":47,"第4名":45,"第5名":44,"第6名":42 }。现需要查询第3名成绩,下列表达式正确的是?( )
电子学会-Python-L5
困难
--
A17953
执行下面Python程序,一共可以输出多少个‘*’?( )for i in range(3): for j in range(5): print('*', end=' ') print()
电子学会-Python-L5
困难
--
A17954
循环语句 for i in range(8,-8,-2):执行了几次循环?( )
电子学会-Python-L5
困难
--
A17955
以下Python程序运行后的结果为?( )for i in range(1,11,2): print(i,end='、')
电子学会-Python-L5
困难
--
A17956
下列关于元组的描述,错误的是?( )
电子学会-Python-L5
困难
--
A17957
numpy数组的切片操作返回的是原数组数据的视图(view),而非副本(copy),修改视图会影响原数组。( )
电子学会-Python-L6
困难
--
A17958
plt.hist()函数用于绘制数据的直方图,以展示数值数据的分布情况。( )
电子学会-Python-L6
困难
--
A17959
在Python的SQLite中,cursor.close()方法调用后,可以继续使用该游标执行更多的数据库操作。( )
电子学会-Python-L6
困难
--
A17960
在Python中,类属性(定义在类内部,但在方法之外)被该类的所有实例共享。( )
电子学会-Python-L6
困难
--
A17961
open()函数的'rb+'模式表示以二进制的格式打开一个文件用于读写。文件指针将会放在文件开头。( )
电子学会-Python-L6
困难
--
A17962
在Python中,要想将一个字符串写入一个文件,可以使用write方法,例如f.write('Hello, world!')。( )
电子学会-Python-L6
困难
--
A17963
以下Python程序可以提取 5 到 9之间的所有数据元素。( )import numpy as np a = np. arange(10) print(a[(a<=9) & (a>=5)])
电子学会-Python-L6
困难
--
A17964
运行以下Python程序,一定会生成如下图所示的窗体。( )import tkinter as tk win = tk.Tk() win.geometry("200x120") def a(): win.quit() win.destroy() b = tk.Button(win, text='退出', command=a, width=10, height=2) b.pack(expand=T…
电子学会-Python-L6
困难
--
A17965
如下程序所示,定义类时,如果没有属性,可以省略def __init__(self)语句。( )class Car(): def left(self): print("左转") def right(self): print("右转") c = Car() c.left()
电子学会-Python-L6
困难
--
A17966
用Python编程绘制如下图形,需要用到plt.scatter(x, np.sin(x))语句。( )
电子学会-Python-L6
困难
--
A17967
下列Python代码使用Matplotlib库绘制了一个什么样的图形?( )import matplotlib.pyplot as plt x = [1, 2, 3, 4, 5] y = [1, 4, 9, 16, 25] plt.plot(x, y) plt.show()
电子学会-Python-L6
困难
--
A17968
以下Python代码的输出是?( )import numpy as np arr = np.array([[1, 2], [3, 4]]) result = np.sum(arr, axis=0) print(result)
电子学会-Python-L6
困难
--
A17969
运行以下Python代码的输出是?( )import numpy as np arr = np.array([1, 2, 3, 4, 5]) result = np.mean(arr) print(result)
电子学会-Python-L6
困难
--
A17970
使用Python的matplotlib绘制图形时,plt.legend()函数的作用是?( )
电子学会-Python-L6
困难
--