1 / 40
文档名称:

python测试题.doc

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

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

分享

预览

python测试题.doc

上传人:2982835315 2022/3/2 文件大小:67 KB

下载得到文件列表

python测试题.doc

文档介绍

文档介绍:-
. z.
does the following code do"(B)
def a(b, c, d): pass
a list hat gets printed"(C)
* = True
y = False
z = False
if not * or y:
print 1
elif not * or not y and z:
print 2
elif not * or y or not y and *:
print 3
else:
print 4
-
. z.




14. If PYTHONPATH is set in the environment, which directories are searched for modules"(D)
A) PYTHONPATH directory
B) current directory
C) home directory
D) installation dependent default path
only
and D
, B, and C
, B, and D
, B, C, and D
15. In python or earlier, the code will print error type 1 if accessSecureSystem raises an e*ception of either AccessError type or SecurityError type(B)
try:
accessSecureSystem()
e*cept AccessError, SecurityError:
print "error type 1"
-
. z.
continueWork()


16. The following code will successfully print the days and then the months(B)
daysOfWeek = ['Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
'Sunday']
months = ['Jan', \
'Feb', \
'Mar', \
'Apr', \
'May', \
'Jun', \
'Jul', \
'Aug', \
'Sep', \
'Oct', \
-
. z.
'Nov', \
'Dec']
print "DAYS: %s, MONTHS %s" %
(daysOfWeek, months)


17. Assuming python what gets printed"(A)
f = None
for i in range (5):
with open("*t", "w") as f:
if i > 2:
break
print



18. What gets printed"(C)
counter = 1
def doLotsOfStuff():
global