版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Python语言程序设计(全英)智慧树知到课后章节答案2023年下华南理工大学华南理工大学
第一章测试
WhichisNOTthemainpartofcomputer()
A:memory
B:CPU
C:Cache
D:I/Oequipment
答案:Cache
WhichsymbolcanbeusedforcommentsinPython()
A://
B:#
C:!
D:“
答案:#
;“
TheintegrateddevelopmenttoolbuiltintoPythonis().
A:IDLE
B:Jupyter
C:Pycharm
D:Vscode
答案:IDLE
Whichisthecorrectoperatorforpower(Xy)?()
A:X**y
B:X^^y
C:X^y
D:Noneofthementioned
答案:X**y
Whichofthefollowingisincorrect?()
A:float(4.2)
B:float("3")
C:float(3)
D:float("3+5")
答案:float("3+5")
第二章测试
Whichofthefollowingisaninvalidvariable?()
A:my_string_1
B:1st_string
C:foo
D:_
答案:1st_string
WhatwillbetheoutputofthefollowingPythoncode?
not(10<20)andnot(10>30)()
A:True
B:Nooutput
C:False
D:Error
答案:False
Whichonewillreturnerrorwhenaccessingthelist‘l’with10elements.()
A:l[-1]
B:l[0]
C:l[-10]
D:l[10]
答案:l[10]
WhatwillbetheoutputofthefollowingPythoncode?
lst=[3,4,6,1,2]
lst[1:2]=[7,8]
print(lst)()
A:[3,[7,8],6,1,2]
B:[3,4,6,7,8]
C:Syntaxerror
D:[3,7,8,6,1,2]
答案:[3,7,8,6,1,2]
Thefollowingprograminputdata:95,theoutputresultis?
(
)
A:
Pleaseenteryourscore:95
Yourabilityexceeds85%ofpeople!
B:
Pleaseenteryourscore:95
Awesome!
Yourabilityexceeds85%ofpeople!
C:
Pleaseenteryourscore:95
Awesome!
D:noneofthementioned
答案:
Pleaseenteryourscore:95
Awesome!
Yourabilityexceeds85%ofpeople!
第三章测试
Whichonedescriptionofconditioninthefollowingsiscorrect?()
A:Thecondition24<=28<25isillegal
B:Thecondition24<=28<25islegal,andtheoutputisTrue
C:Thecondition24<=28<25islegal,andtheoutputisFalse
D:Thecondition35<=45<75islegal,andtheoutputisFalse
答案:Thecondition24<=28<25islegal,andtheoutputisFalse
Theoutputofthefollowingprogramis?(
)
A:Python
B:python
C:None
D:t
答案:None
forvarin___:(
)
A:13.5
B:[1,2,3]
C:"Hello"
D:range(0,10)
答案:13.5
Afterthefollowingprogramisexecuted,thevalueofsis?(
)
A:9
B:47
C:19
D:46
答案:9
Whichistheoutputofthefollowingcode?a=30
b=1
ifa>=10:
a=20
elifa>=20:
a=30
elifa>=30:
b=a
else:
b=0
print("a=",a,"b=",b)()
A:a=30,b=1B:a=30,b=30C:a=20,b=1D:a=20,b=20
答案:a=20,b=1
第四章测试
WhichkeywordisusedtodefineafunctioninPython?()
A:fun
B:define
C:function
D:def
答案:def
WhatwillbetheoutputofthefollowingPythoncode?
(
)
A:
xis50
Changedlocalxto2
xisnow2
B:
xis50
Changedlocalxto2
xisnow50
C:
xis50
Changedlocalxto2
xisnow100
D:Noneofthementioned
答案:
xis50
Changedlocalxto2
xisnow50
WhicharetheadvantagesoffunctionsinPython?()
A:Improvingclarityofthecode
B:Easiertomanagethecode
C:Reducingduplicationofcode
D:Decomposingcomplexproblemsintosimplerpieces
答案:Improvingclarityofthecode
;Easiertomanagethecode
;Reducingduplicationofcode
;Decomposingcomplexproblemsintosimplerpieces
Howdoesthevariablelengthargumentspecifiedinthefunctionheading?()
A:twostarsfollowedbyavalididentifier
B:twounderscoresfollowedbyavalididentifier
C:oneunderscorefollowedbyavalididentifier
D:onestarfollowedbyavalididentifier
答案:onestarfollowedbyavalididentifier
WhatwillbetheoutputofthefollowingPythoncode?
list(map((lambdax:x**2),filter((lambdax:x%2==0),range(10))))()
A:Error
B:[0,4,16,36,64]
C:Nooutput
D:[0,1,2,3,4,5,6,7,8,9]
答案:[0,4,16,36,64]
第五章测试
Whichofthefollowingstatementscannotcreateademo.txtfile?()
A:f=open("demo.txt","x")
B:f=open("demo.txt","r")
C:f=open("demo.txt","w")
D:f=open("demo.txt","a")
答案:f=open("demo.txt","r")
Afterexecutingthefollowingprocedure,whatcontentwillbesavedinthefile?
file=open('test.txt','wt+')
file.write('helloSCUT')
file.close()
file=open('test.txt','at+')
file.write('helloworld')
file.close()()
A:helloSCUThelloworld
B:helloworld
C:helloSCUThelloworld
D:helloSCUTworld
答案:helloSCUThelloworld
WhichfunctionisnotthewayPythonreadsfiles.()
A:readtext()
B:read()
C:readline()
D:readlines()
答案:readtext()
HowtorenameafileinPython?()
A:=‘new_name.txt’
B:os.rename(fp,new_name)
C:os.set_name(existing_name,new_name)
D:os.rename(existing_name,new_name)
答案:os.rename(existing_name,new_name)
Whatistheusageoftell()functioninPython?()
A:tellsyoutheendpositionwithinthefile
B:noneofthementioned
C:tellsyouthecurrentpositionwithinthefile
D:tellsyouthefileisopenedornot
答案:tellsyouthecurrentpositionwithinthefile
第六章测试
WhatwillbetheoutputofthefollowingPythoncode?(
)
A:Reportserrorasoneargumentisrequiredwhilecreatingtheobject
B:Reportserrorasdisplayfunctionrequiresadditionalargument
C:Displays0,whichistheautomaticdefaultvalue
D:Runsnormally,doesn’tdisplayanything
答案:Reportserrorasoneargumentisrequiredwhilecreatingtheobject
WhatwillbetheoutputofthefollowingPythoncode?
(
)
A:‘Old’
B:Nothingisprinted
C:‘New’
D:Error
答案:‘Old’
WhatwillbetheoutputofthefollowingPythoncode?
(
)
A:Exceptionisthrown
B:__main__
C:test
D:Demo
答案:__main__
WhichoneofthefollowingsisnotcorrectaboutClasshierarchy?()
A:Subclasscaninheritallattributesfromsuperclass
B:Subclasscanhavemethodswithsamenameassuperclass
C:Subclasscanoverridethemethodsinheritedfromsuperclass
D:Subclasscannotaddmorebehavior/methods
答案:Subclasscannotaddmorebehavior/methods
WhatwillbetheoutputofthefollowingPythoncode?
(
)
A:00
B:Error,thesyntaxoftheinvokingmethodiswrong
C:01
D:ErrorbecauseclassBinheritsAbutvariablexisn’tinherited
答案:01
第七章测试
Numpyisathirdpartypackagefor____inPython?()
A:Lambdafunction
B:Array
C:Typecasting
D:Function
答案:Array
HowtoconvertaNumpyarraytoalistinPython?()
A:list.append(array)
B:array.list
C:list(array)
D:list.array
答案:list(array)
WhichkeywordisusedtoaccesstheNumpypackageinPython?()
A:from
B:import
C:fetch
D:load
答案:import
Whichoneiscorrectsyntaxforthe‘reshape()’functioninNumpy?()
A:reshape(shape,array)
B:reshape(array,shape)
C:array.reshape(shape)
D:reshape(shape)
答案:reshape(array,shape)
Whatwillbetheoutputforthefollowingcode?
importnumpyasnp
a=np.array([1,2,3],dtype=complex)
print(a)()
A:[[1.+0.j,2.+0.j,3.+0.j]]
B:[1.+0.j,2.+0.j,3.+0.j]
C
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026第一季度湖南盐业集团有限公司所属企业招聘62人笔试备考试题及答案解析
- 2026湖南高速集团旗下分子公司招聘103人笔试备考题库及答案解析
- 2026河南濮阳油田总医院招聘笔试备考试题及答案解析
- 2026镇远振兴农业产业发展有限公司招聘笔试备考试题及答案解析
- 2026四川雅安市金服科技有限公司招聘1人笔试备考试题及答案解析
- 2026年北京科技大学天津学院高职单招职业适应性测试模拟试题及答案详细解析
- 2026江苏常州市溧阳市卫生健康系统部分事业单位招聘高层次人才38人(长期)笔试备考试题及答案解析
- 2026河南信阳衡水高级中学、罗山县衡水高级中学招聘高中教师笔试备考试题及答案解析
- 2025贵阳产业发展控股集团有限公司集中招聘27人笔试备考试题及答案解析
- 2026天津西青区卫健委所属事业单位招聘56人笔试备考题库及答案解析
- 2026年山东中医药高等专科学校高职单招职业适应性考试模拟试题含答案解析
- (正式版)DB51∕T 3322-2025 《水利工程建设质量检测管理规范》
- 《制氢现场氢安全管理规范》
- 2025版压力性损伤预防和治疗的新指南解读
- 消控证考试题库及答案中级
- 部编版八年级语文下册文言文汇编(原文注释)
- 体内植入物在电外科的使用
- 股权激励协议范本
- 天堂旅行团读书分享
- 墓碑上的100个药方
- 乳液聚合乳液聚合机理
评论
0/150
提交评论