




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
Python語言程序設(shè)計(jì)(全英)知到智慧樹章節(jié)測試課后答案2024年秋華南理工大學(xué)第一章單元測試
WhichisNOTthemainpartofcomputer()
A:I/Oequipment
B:CPU
C:memory
D:Cache
答案:Cache
WhichsymbolcanbeusedforcommentsinPython()
A:#
B:!
C:“
D://
答案:#
;“
TheintegrateddevelopmenttoolbuiltintoPythonis().
A:Vscode
B:Pycharm
C:Jupyter
D:IDLE
答案:IDLE
Whichisthecorrectoperatorforpower(Xy)?()
A:X^y
B:X**y
C:X^^y
D:Noneofthementioned
答案:X**y
Whichofthefollowingisincorrect?()
A:float("3")
B:float(3)
C:float("3+5")
D:float(4.2)
答案:float("3+5")
第二章單元測試
Whichofthefollowingisaninvalidvariable?()
A:foo
B:1st_string
C:my_string_1
D:_
答案:1st_string
WhatwillbetheoutputofthefollowingPythoncode?
not(10<20)andnot(10>30)()
A:Nooutput
B:True
C:Error
D:False
答案:False
Whichonewillreturnerrorwhenaccessingthelist‘l’with10elements.()
A:l[-10]
B:l[10]
C:l[0]
D:l[-1]
答案: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]
Whichofthefollowingoperationswillrightlymodifythevalueoftheelement?()
A:
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'
答案:
t=['h','e','l','l','o']
t[0]='H'
Thefollowingprograminputdata:95,theoutputresultis?
(
)
A:noneofthementioned
B:
Pleaseenteryourscore:95
Awesome!
Yourabilityexceeds85%ofpeople!
C:
Pleaseenteryourscore:95
Awesome!
D:
Pleaseenteryourscore:95
Yourabilityexceeds85%ofpeople!
答案:
Pleaseenteryourscore:95
Awesome!
Yourabilityexceeds85%ofpeople!
第三章單元測試
Whichonedescriptionofconditioninthefollowingsiscorrect?()
A:Thecondition35<=45<75islegal,andtheoutputisFalse
B:Thecondition24<=28<25islegal,andtheoutputisTrue
C:Thecondition24<=28<25isillegal
D:Thecondition24<=28<25islegal,andtheoutputisFalse
答案:Thecondition24<=28<25islegal,andtheoutputisFalse
Theoutputofthefollowingprogramis?(
)
A:None
B:t
C:Python
D:python
答案:None
forvarin___:(
)
A:range(0,10)
B:"Hello"
C:[1,2,3]
D:13.5
答案:13.5
Afterthefollowingprogramisexecuted,thevalueofsis?(
)
A:46
B:19
C:47
D:9
答案: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=20,b=1B:a=20,b=20C:a=30,b=1D:a=30,b=30
答案:a=20,b=1
第四章單元測試
WhichkeywordisusedtodefineafunctioninPython?()
A:def
B:fun
C:define
D:function
答案:def
WhatwillbetheoutputofthefollowingPythoncode?
(
)
A:
xis50
Changedlocalxto2
xisnow2
B:
xis50
Changedlocalxto2
xisnow100
C:
xis50
Changedlocalxto2
xisnow50
D:Noneofthementioned
答案:
xis50
Changedlocalxto2
xisnow50
WhicharetheadvantagesoffunctionsinPython?()
A:Reducingduplicationofcode
B:Improvingclarityofthecode
C:Decomposingcomplexproblemsintosimplerpieces
D:Easiertomanagethecode
答案:Reducingduplicationofcode
;Improvingclarityofthecode
;Decomposingcomplexproblemsintosimplerpieces
;Easiertomanagethecode
Howdoesthevariablelengthargumentspecifiedinthefunctionheading?()
A:oneunderscorefollowedbyavalididentifier
B:onestarfollowedbyavalididentifier
C:twounderscoresfollowedbyavalididentifier
D:twostarsfollowedbyavalididentifier
答案: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","r")
B:f=open("demo.txt","w")
C:f=open("demo.txt","x")
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:helloSCUThelloworld
C:helloSCUTworld
D:helloworld
答案:helloSCUThelloworld
WhichfunctionisnotthewayPythonreadsfiles.()
A:readline()
B:readtext()
C:read()
D:readlines()
答案:readtext()
HowtorenameafileinPython?()
A:os.set_name(existing_name,new_name)
B:os.rename(existing_name,new_name)
C:=‘new_name.txt’
D:os.rename(fp,new_name)
答案:os.rename(existing_name,new_name)
Whatistheusageoftell()functioninPython?()
A:tellsyouthefileisopenedornot
B:tellsyouthecurrentpositionwithinthefile
C:noneofthementioned
D:tellsyoutheendpositionwithinthefile
答案:tellsyouthecurrentpositionwithinthefile
第六章單元測試
WhatwillbetheoutputofthefollowingPythoncode?(
)
A:Runsnormally,doesn’tdisplayanything
B:Reportserrorasdisplayfunctionrequiresadditionalargument
C:Displays0,whichistheautomaticdefaultvalue
D:Reportserrorasoneargumentisrequiredwhilecreatingtheobject
答案:Reportserrorasoneargumentisrequiredwhilecreatingtheobject
WhatwillbetheoutputofthefollowingPythoncode?
(
)
A:Nothingisprinted
B:‘New’
C:Error
D:‘Old’
答案:‘Old’
WhatwillbetheoutputofthefollowingPythoncode?
(
)
A:Demo
B:__main__
C:Exceptionisthrown
D:test
答案:__main__
WhichoneofthefollowingsisnotcorrectaboutClasshierarchy?()
A:Subclasscannotaddmorebehavior/methods
B:Subclasscanoverridethemethodsinheritedfromsuperclass
C:Subclasscaninheritallattributesfromsuperclass
D:Subclasscanhavemethodswithsamenameassuperclass
答案:Subclasscannotaddmorebehavior/methods
WhatwillbetheoutputofthefollowingPythoncode?
(
)
A:00
B:01
C:ErrorbecauseclassBinheritsAbutvariablexisn’tinherited
D:Error,thesyntaxoftheinvokingmethodiswrong
答案:01
第七章單元測試
Numpyisathirdpartypackagefor____inPython?()
A:Lambdafunction
B:Typecasting
C:Array
D:Function
答案:Array
HowtoconvertaNumpyarraytoalistinPython?()
A:list.append(array)
B:list.array
C:list(array)
D:array.list
答案:list(array)
WhichkeywordisusedtoaccesstheNumpypackageinPython?()
A:from
B:fetch
C:load
D:import
答案:import
Whichoneiscorrectsyntaxforthe‘reshape()’functioninNumpy?()
A:reshape(shape,array)
B:array.reshape(shape)
C:reshape(array,shape)
D:reshape(shape)
答案:reshape(array,shape)
Whatwillbetheoutputforthefollowingcode?
importnumpyasnp
a=np.array([1,2,3],dtype=complex)
print(a)()
A:Error
B:[1.+0.j,2.+0.j,3.+0.
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(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)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 校園學(xué)生宿舍用品合作合同(2篇)
- 職業(yè)技術(shù)學(xué)院2024級工程造價(jià)專業(yè)人才培養(yǎng)方案
- 2025房產(chǎn)抵押借款合同模板
- 2025最簡化租房合同范例:最簡化租房合同樣本
- 2025年初級銀行從業(yè)資格之初級個(gè)人理財(cái)題庫附答案(典型題)
- N-乙酰谷氨酸合成酶缺乏癥的臨床護(hù)理
- 2025工程設(shè)計(jì)與施工合同
- 發(fā)展新質(zhì)生產(chǎn)力策略
- 人教九年級化學(xué)思維導(dǎo)圖
- 2025(新舊)房產(chǎn)買賣合同
- 比例尺單元測試卷及答案
- 氬弧焊基本知識課件
- 《廣西壯族自治區(qū)基層工會(huì)經(jīng)費(fèi)收支管理實(shí)施辦法》修訂解讀
- 2024北京朝陽城市發(fā)展集團(tuán)有限公司社會(huì)化招聘專場筆試參考題庫附帶答案詳解
- 中職語文教學(xué)大賽教學(xué)實(shí)施報(bào)告范文與解析
- 北京市朝陽區(qū)2025屆高三下學(xué)期一模試題 數(shù)學(xué) 含答案
- 食品工廠5S管理
- 大數(shù)據(jù)在展覽中的應(yīng)用-全面剖析
- 食品企業(yè)危機(jī)應(yīng)對措施
- T-FJZYC 10-2024 金線蓮規(guī)范化生產(chǎn)技術(shù)規(guī)程
- 2025年四川省成都市“蓉漂”人才薈武候區(qū)招聘23人歷年自考難、易點(diǎn)模擬試卷(共500題附帶答案詳解)
評論
0/150
提交評論