信息
You have already completed the 测验 before. Hence you can not start it again.
You must sign in or sign up to start the 测验.
测验 complete. Results are being recorded.
0 of 20 问题 answered correctly
Your time:
时间已经过去了
You have reached 0 of 0 point(s), (0 )
Earned Point(s): 0 of 0 , (0 )
0 Essay(s) Pending (Possible Point(s): 0 )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
题 1 of 20
1:
对于数列3,8,11,15,17,19,25,30,44,采用“二分查找”法查找8,需要查找多少次?( )
题 2 of 20
题 3 of 20
3: 有如下Python语句,执行该语句后,结果是?( ) f=lambda x:5 print(f(3))
题 4 of 20
4:
执行如下Python代码后,结果是?( ) def inverse(s,n=0): while s: n = n * 10 + s % 10 s = s // 10 return n print(inverse(456,123))
题 5 of 20
题 6 of 20
6:
以下有关Python函数的定义表述中错误的是?( )
题 7 of 20
7:
如下代码运行后下面选项中描述错误的是?( ) def pph(a,b): c=a**2+b b=a return c a=10 b=100 c=pph(a,b)+a print(a,’ ‘,b,’ ‘,c)
题 8 of 20
8:
阅读下列程序段,数列的第6项值为多少?( ) def fibona(x): if x==1 or x==2: f=1 for i in range(3,x+1): f=fibona(x-1)+fibona(x-2) return f n=int(input(“请输入数列第几项:”)) m=fibona(n) print(“数列的第”+str(n)+”项的值为”+str(m))
题 9 of 20
9: 有如下Python的自定义函数,执行该程序后,结果是?( ) def calc(x,y,op): return eval(str(x)+op+str(y)) print(calc(3,5,’+’))
题 10 of 20
10:
有如下Python程序,执行该程序后,结果是?( ) x = 3 def calc(): x = 5 print(calc())
题 11 of 20
题 12 of 20
12:
有一球从100米高度自由落下,每次落地后反跳回原高度的一半,再落下,求它在第10次落地前,反弹多高?用递归函数解决,下面选项正确的是?( )
题 13 of 20
13:
有如下Python程序,执行该程序后,结果是?( )
g = lambda x,y=3,z=5:x+y+z
print(g(2))
题 14 of 20
14:
下面的程序输出1~100之间能被7整除但不能同时被5整除的所有整数。 k=1 while k<101: if k%7==0 and k%5 !=0: print(k) k += 1 根据下面哪个选项的方法优化后,程序的运行效率最高?( )
题 15 of 20
15:
下列程序段的运行结果为?( ) def f(n): if n<=1: return 1 else: return f(n-1)*3 print(f(5))
题 16 of 20
16:
下列选项中,关于如何安装第三方库的说法正确的是?( )
题 17 of 20
17:
运行以下程序输出的结果是?( ) y=2 def fun(): global y y=1 print(y) fun() print(y)
题 18 of 20
题 19 of 20
题 20 of 20
20:
观察此题示例代码,以下表述中错误的是?( ) nums = range(2,20) for i in nums: nums=list( filter(lambda x:x==i or x % i,nums)) print(nums)