1 / 55
文档名称:

python测试题.doc

格式:doc   大小:74KB   页数:55页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

python测试题.doc

上传人:2982835315 2021/12/5 文件大小:74 KB

下载得到文件列表

python测试题.doc

文档介绍

文档介绍:-
. 优选-
does the following code do"(B)
def a(b, c, d): pass
a list and initializes it
a function, which does nothing
a function, which passes its parameters through
an empty class
gets printed" Assuming python version (A)
print type(1/2)
A.<type 'int'>
B.<type 'number'>
C.<type 'float'>
D.<type 'double'>
E.<type 'tuple'>
3. what is the output of the following code"(E)
print type([1,2])
A.<type 'tuple'>
B.<type 'int'>
-
. 优选-
C.<type 'set'>
D.<type 'complex'>
E.<type 'list'>
4. what gets printed"(C)
def f(): pass
print type(f())
A.<type 'function'>
B.<type 'tuple'>
C.<type 'NoneType'>
D.<type 'str'>
E.<type 'type'>
5. what should the below code print"(A)
print type(1J)
A.<type 'complex'>
B.<type 'unicode'>
C.<type 'int'>
D.<type 'float'>
E.<type 'dict'>
-
. 优选-
6. what is the output of the following code"(D)
print type(lambda:None)
A.<type 'NoneType'>
B.<type 'tuple'>
C.<type 'type'>
D.<type 'function'>
E.<type 'bool'>
7. what is the output of the below program"(D)
a = [1,2,3,None,(),[],]
print len(a)
error




gets printed" Assuming python version (C)
print (type(1/2))
-
. 优选-
A.<type 'int'>
B.<type 'number'>
C.<type 'float'>
D.<type 'double'>
E.<type 'tuple'>
9. What gets printed"(C)
d = lambda p: p * 2
t = lambda p: p * 3
x = 2
x = d(x)
x = t(x)
x = d(x)
print x





-
. 优选-
10. What gets printed"(A)
x