Python語言程序設(shè)計(jì)(全英)知到智慧樹章節(jié)測(cè)試課后答案2024年秋華南理工大學(xué)_第1頁
Python語言程序設(shè)計(jì)(全英)知到智慧樹章節(jié)測(cè)試課后答案2024年秋華南理工大學(xué)_第2頁
Python語言程序設(shè)計(jì)(全英)知到智慧樹章節(jié)測(cè)試課后答案2024年秋華南理工大學(xué)_第3頁
Python語言程序設(shè)計(jì)(全英)知到智慧樹章節(jié)測(cè)試課后答案2024年秋華南理工大學(xué)_第4頁
Python語言程序設(shè)計(jì)(全英)知到智慧樹章節(jié)測(cè)試課后答案2024年秋華南理工大學(xué)_第5頁
已閱讀5頁,還剩8頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

Python語言程序設(shè)計(jì)(全英)知到智慧樹章節(jié)測(cè)試課后答案2024年秋華南理工大學(xué)第一章單元測(cè)試

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")

第二章單元測(cè)試

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!

第三章單元測(cè)試

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

第四章單元測(cè)試

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]

第五章單元測(cè)試

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

第六章單元測(cè)試

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

第七章單元測(cè)試

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

評(píng)論

0/150

提交評(píng)論