1 / 28
文档名称:

PYTHON测试题.doc

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

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

分享

预览

PYTHON测试题.doc

上传人:书生教育 2022/3/13 文件大小:967 KB

下载得到文件列表

PYTHON测试题.doc

文档介绍

文档介绍:-2020AsposePtyLtd.
?(rint"no"



Whatgetsprinted?(C)x=True
y=Falsez=False
ifnotxory:
print1
elifnotxornotyandz:
print2
-2020AsposePtyLtd.
elifnotxoryornotyandx:
print3
else:
print4




IfPYTHONPATHissetintheenvironment,whichdirectoriesaresearchedformodules?(D)
PYTHONPATHdirectory
currentdirectory
homedirectory
installationdependentdefaultpath
only
,B,,B,,B,C,andD
,thecodewillprinterrortype1ifaccessSecureSystemraisesanexceptionofeitherAccessErrortypeorSecurityErrortype(B)
try:
accessSecureSystem( )
exceptAccessError,SecurityError:
print"errortype1"
continueWork( )


(B)
daysOfWeek=['Monday',
'Tuesday',
-2020AsposePtyLtd.
'Wednesday',
'Thursday',
'Friday',
'Saturday',
'Sunday']
months= ['Jan',\
'Feb',\
'Mar',\
'Apr',\
'May',\
'Jun',\
'Jul',\
'Aug',\
'Sep',\
'Oct',\
'Nov',\
'Dec']
print"DAYS:%s,MONTHS%s"%
(daysOfWeek,months)


?(A)
f=None
foriinrange(5):
withopen("","w")asf:
ifi>2:
break




?(C)
counter=1
-2020AsposePtyLtd.
defdoLotsOfStuff( ):
globalcounter
foriin(1,2,3):
counter+=1
doLotsOfStuff( )
printcounter





Whatgetsprinted?(C)printr"\nwoow"

最近更新