1 / 9
文档名称:

PYTHON测试题.docx

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

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

分享

预览

PYTHON测试题.docx

上传人:秋江孤影 2022/6/4 文件大小:70 KB

下载得到文件列表

PYTHON测试题.docx

文档介绍

文档介绍:whatdoesthefollowingcodedo"B)defa(b,c,d):passdefinesalistandinitializesitdefinesafunction,whichdoesnothingdefinesafunctiJun',\'Jul',\'Aug',\'Sep',\'Oct',\'Nov',\'Dec']print"DAYS:%s,MONTHS%s"%
(daysOfWeek,months)")f=Noneforiinrange(5):
withopen("","w")asf:
ifi>2:
'C)counter=1defdoLotsOfStuff():globalcounterforiin(1,2,3):
counter+=1doLotsOfStuff()printcounter1347noneoftheaboveWhatgetsprinted'C)printr"\nwoow"newlinethenthestring:woowthetextexactlylikethis:r"\nwoow"thetextlikeexactlylikethis:\nwoowtheletterrandthennewlinethenthetext:woowtheletterrthenthetextlikethis:nwoowWhatgetsprinted'B)print"hello"'world'ononelinethetext:helloworldononelinethetext:helloworld
helloononelineandworldonthenextlinesyntaxerror,thispythonprogramwillnotrunWhatgetsprinted'©print"\x48\x49!"\x48\x49!
48494849!
4849!
HI!
Whatgetsprinted'D)print0xA+0xaOxA+OxaOxAOxa14200x20Whatgetsprinted'©classparent:
def__init__(self,param):
=paramclasschild(parent):
def__init__(self,param):
=paramobj=child(11)print"%d%d"%(,)NoneNoneNone1111None1111ErrorisgeneratedbyprogramWhatgetsprinted'©kvps={"user","bill","password","hillary"}printkvps['password']'B)66%on1871timesaskedclassAccount:
def__init__(self,id):
=idid=6