在线网课知道《Python语言程序设计(全英)(华南理工大学)》单元测试考核答案_第1页
在线网课知道《Python语言程序设计(全英)(华南理工大学)》单元测试考核答案_第2页
在线网课知道《Python语言程序设计(全英)(华南理工大学)》单元测试考核答案_第3页
在线网课知道《Python语言程序设计(全英)(华南理工大学)》单元测试考核答案_第4页
在线网课知道《Python语言程序设计(全英)(华南理工大学)》单元测试考核答案_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

第一章单元测试1【单选题】(20分)WhichisNOTthemainpartofcomputer()A.CacheB.I/OequipmentC.memoryD.CPU2.【多选题】(20分)正确答案:CDWhichsymbolcanbeusedforcommentsinPython()A.//B.!C.“D.#3【单选题】(20分)TheintegrateddevelopmenttoolbuiltintoPythonis().A.VscodeB.IDLEC.JupyterD.Pycharm4【单选题】(20分)Whichisthecorrectoperatorforpower(Xy)?()A.NoneofthementionedB.X^yC.X**yD.X^^y5【单选题】(20分)Whichofthefollowingisincorrect?()A.float(3)B.float(4.2)C.float("3")D.float("3+5")第二章单元测试1【单选题】(20分)Whichofthefollowingisaninvalidvariable?()A.my_string_1B.fooC._D.1st_string2【单选题】(20分)WhatwillbetheoutputofthefollowingPythoncode?not(10<20)andnot(1030)()A.NooutputB.TrueC.FalseD.Error3【单选题】(20分)Whichonewillreturnerrorwhenaccessingthelist‘l’with10elements.()A.l[-1]B.l[10]C.l[-10]D.l[0]4【单选题】(20分)WhatwillbetheoutputofthefollowingPythoncode?lst=[3,4,6,1,2]lst[1:2]=[7,8]print(lst)()A.[3,[7,8],6,1,2]B.[3,7,8,6,1,2]C.SyntaxerrorD.[3,4,6,7,8]5【单选题】(20分)WhichofthefollowingoperationswillrightlymodifytheA.t=['h','e','l','l','o']t[0]='H'B.s='hello's[0]='H'C.t={'h','e','l','l','o'}t[0]='H'D.t=('h','e','l','l','o')t[0]='H'6【单选题】(20分)Thefollowingprograminputdata:95,theoutputresultis?()A.noneofthementionedB.Pleaseenteryourscore:95Yourabilityexceeds85%ofpeople!C.Pleaseenteryourscore:95Awesome!Yourabilityexceeds85%ofpeople!D.Pleaseenteryourscore:95Awesome!第三章单元测试1【单选题】(20分)Whichonedescriptionofconditioninthefollowingsiscorrect?()A.Thecondition24<=28<25islegal,andtheoutputisFalseB.Thecondition24<=28<25isillegalC.Thecondition24<=28<25islegal,andtheoutputisTrueD.Thecondition35<=45<75islegal,andtheoutputisFalse2【单选题】(20分)Theoutputofthefollowingprogramis?()A.PythonB.NoneC.pythonD.t3【单选题】(20分)forvarin___:()A.range(0,10)B."Hello"C.13.5D.[1,2,3]4【单选题】(20分)Afterthefollowingprogramisexecuted,theA.19B.9C.47D.465【单选题】(20分)Whichistheoutputofthefollowingcode?a=30b=1ifa=10:a=20elifa=20:a=30elifa=30:b=aelse:b=0print("a=",a,"b=",b)()A.a=20,b=20B.a=30,b=1C.a=20,b=1D.a=30,b=30第四章单元测试1【单选题】(20分)WhichkeywordisusedtodefineafunctioninPython?()A.defineB.defC.functionD.fun2【单选题】(20分)WhatwillbetheoutputofthefollowingPythoncode?()A.xis50Changedlocalxto2xisnow50B.xis50Changedlocalxto2xisnow100C.NoneofthementionedD.xis50Changedlocalxto2xisnow23.【多选题】(20分)正确答案:ABCDWhicharetheadvantagesoffunctionsinPython?()A.ReducingduplicationofcodeB.EasiertomanagethecodeC.ImprovingclarityofthecodeD.Decomposingcomplexproblemsintosimplerpieces4【单选题】(20分)Howdoesthevariablelengthargumentspecifiedinthefunctionheading?()A.twostarsfollowedbyavalididentifierB.oneunderscorefollowedbyavalididentifierC.onestarfollowedbyavalididentifierD.twounderscoresfollowedbyavalididentifier5【单选题】(20分)WhatwillbetheoutputofthefollowingPythoncode?list(map((lambdax:x**2),filter((lambdax:x%2==0),range(10))))()A.NooutputB.ErrorC.[0,1,2,3,4,5,6,7,8,9]D.[0,4,16,36,64]第五章单元测试1【单选题】(20分)Whichofthefollowingstatementscannotcreateademo.txtfile?()A.f=open("demo.txt","r")B.f=open("demo.txt","a")C.f=open("demo.txt","w")D.f=open("demo.txt","x")2【单选题】(20分)Afterexecutingthefollowingprocedure,whatcontentwillbesavedinthefile?file=open('test.txt','wt+')file.write('helloSCUT')file.close()file=open('test.txt','at+')file.write('helloworld')file.close()()A.helloSCUTworldB.helloSCUThelloworldC.helloSCUThelloworldD.helloworld3【单选题】(20分)WhichfunctionisnotthewayPythonreadsfiles.()A.readtext()B.readlines()C.readline()D.read()4【单选题】(20分)HowtorenameafileinPython?()A.os.rename(fp,new_name)B.os.set_name(existing_name,new_name)C.os.rename(existing_name,new_name)D.=‘new_name.txt’5【单选题】(20分)Whatistheusageoftell()functioninPython?()A.noneofthementionedB.tellsyoutheendpositionwithinthefileC.tellsyouthecurrentpositionwithinthefileD.tellsyouthefileisopenedornot第六章单元测试1【单选题】(20分)WhatwillbetheoutputofthefollowingPythoncode?()A.ReportserrorasoneargumentisrequiredwhilecreatingtheobjectB.Runsnormally,doesn’tdisplayanythingC.ReportserrorasdisplayfunctionrequiresadditionalargumentD.Displays0,whichistheautomaticdefaultA.‘New’B.NothingisprintedC.ErrorD.‘Old’3【单选题】(20分)WhatwillbetheoutputofthefollowingPythoncode?()A.testB.DemoC.__main__D.Exceptionisthrown4【单选题】(20分)WhichoneofthefollowingsisnotcorrectaboutClasshierarchy?()A.SubclasscaninheritallattributesfromsuperclassB.SubclasscanoverridethemethodsinheritedfromsuperclassC.Subclasscannotaddmorebehavior/methodsD.Subclasscanhavemethodswithsamenameassuperclass5【单选题】(20分)WhatwillbetheoutputofthefollowingPythoncode?()A.ErrorbecauseclassBinheritsAbutvariablexisn’tinheritedB.00C.01D.Error,thesyntaxoftheinvokingmethodiswrong第七章单元测试1【单选题】(20分)Numpyisathirdpartypackagefor____inPython?()A.FunctionB.ArrayC.TypecastingD.Lambdafunction2【单选题】(20分)HowtoconvertaNumpyarraytoalistinPython?()A.list(array)B.array.listC.list.append(array)D.list.array3【单选题】(20分)WhichkeywordisusedtoaccesstheNumpypackageinPython?()A.loadB.fetchC.fromD.import4【单选题】(20分)Whichoneiscorrectsyntaxforthe‘reshape()’functioninNumpy?()A.reshape(array,shape)B.array.reshape(shape)C.reshape(shape,array)D.reshape(shape)5【单选题】(20分)Whatwillbetheoutputforthefollowingcode?importnumpyasnpa=np.array([1,2,3],dtype=complex)print(a)()A.[[1.+0.j,2.+0.j,3.+0.j]]B.[1.

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论