在線網(wǎng)課知道《Python語言程序設(shè)計(全英)(華南理工大學(xué))》單元測試考核答案_第1頁
在線網(wǎng)課知道《Python語言程序設(shè)計(全英)(華南理工大學(xué))》單元測試考核答案_第2頁
在線網(wǎng)課知道《Python語言程序設(shè)計(全英)(華南理工大學(xué))》單元測試考核答案_第3頁
在線網(wǎng)課知道《Python語言程序設(shè)計(全英)(華南理工大學(xué))》單元測試考核答案_第4頁
在線網(wǎng)課知道《Python語言程序設(shè)計(全英)(華南理工大學(xué))》單元測試考核答案_第5頁
已閱讀5頁,還剩6頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

第一章單元測試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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論