1 / 23
文档名称:

python测试题.docx

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

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

分享

预览

python测试题.docx

上传人:fangjinyan2017001 2022/3/8 文件大小:33 KB

下载得到文件列表

python测试题.docx

文档介绍

文档介绍:?(B)defa(b,c,d):pass

,whichdoesnothing
CecurityErrortype()try:
accessSecureSystem()
exceptAccessError,SecurityError:print"errortype1"
continueWork()


ThefollowingcodewillsuccessfullyprintthedaysandthenthemonthsB)
daysOfWeek=['Monday','Tuesday',
'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)


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




Whatgetsprinted?C)counter=1
defdoLotsOfStuff():
globalcounter
foriin(1,2,3):counter+=1
doLotsOfStuff()
printcounter





Whatgetsprinted?C)printr"\nwoow
:woow
:r"\nwoow”
:\nwoow
:woow
:nwoow
Whatgetsprinted?B)print"hello"'world
:helloworld
:helloworld

,thispythonprogramwillnotrun
Whatgetsprinted?E)print"\x48\x49!”
A.\x48M49!
49!
!

!
Whatgetsprinted?。)print0xA+0xa
+0xa




Whatgetsprinted?E)classparent:
def__init__(self,param):
=param
classchild(parent):
def__init__(self,param):
=param
obj=child(11)
print"%d%d"%(,)





Whatgetsprinted?E)kvps={"user","bill","password","hillary”}
printkvps['password']





Whatgetsprinted?B)
66%on1871timesaskedclassAccount:
def__init__(self,id):=idid=666
acc=Account(123)




,thisprogramwillnotru