




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
Python語言程序設計(全英)知到智慧樹期末考試答案題庫2025年華南理工大學WhichsymbolcanbeusedforcommentsinPython()
答案:###“Whichoperationcanbeusedtosetthepicturetoagivensize?()
答案:resize()Whichonesbelongtothebasicfunctionsofcomputer()
答案:Calculation,###Datastorage,###Inputandoutput,###ControlWhichonewouldThereadlines()methodreturns?()
答案:alistoflinesWhichonewillreturnerrorwhenaccessingthelist‘l’with10elements.()
答案:l[10]Whichonewilloutputtheresult“python”and“java”:()
答案:ifTrue:print("python")print("java")WhichoneofthefollowingsistrueforvariablenamesinPython?()
答案:unlimitedlengthWhichoneofthefollowingsisthepurposeoffunctioninPython?()
答案:FunctionsarereusablepiecesofprogramsWhichoneofthefollowingsisnotcorrectaboutClasshierarchy?()
答案:Subclasscannotaddmorebehavior/methodsWhichoneofthefollowingsisnotanadvantageofusingmodules?()
答案:ProvidesameansofreducingthesizeoftheprogramWhichoneofthefollowingsisnotakeyword?()
答案:evalWhichoneofthefollowingsisnotakeyword(preservedword)inPython()()
答案:printWhichoneofthefollowingsisnotadatatypesupportedbyPython()
答案:charWhichoneofthefollowingsiscorrectwaytoimporttheNumpymoduleinaprogram?()
答案:AlloftheaboveWhichoneofthefollowingsiscorrectaboutifbranch?()
答案:Useacolonaftereachifcondition:Whichoneofthefollowingsisaninvalidstatement?()
答案:abc=100020003000Whichoneofthefollowingscannotbeavariable?()
答案:inWhichoneofthefollowingstatementsiswrongaboutinheritance?()
答案:PrivatemembersofaclasscanbeinheritedandaccessedWhichoneofthefollowingisnottrueaboutdictionarykeys?()
答案:KeysmustbeintegersWhichoneofthefollowinghasthehighestprecedenceintheexpression?()
答案:ParenthesesWhichoneofthefollowingfunctionswillreturnthesymmetricdifferencebetweentwosets,xandy?()
答案:x^yWhichoneofthefollowingdescriptionofthedictionarytypeiswrong:()
答案:DatainthedictionarytypecanbefragmentedandmergedWhichoneofthefollowingBooleanexpressionsisTrue?()
答案:not(-6>10or-6==10)Whichoneoffollowingsisfloordivision?()
答案://Whichoneisn’tthemethodofImageFilter?()
答案:ImageFilter.SHARPWhichoneisn’tthemethodofImage.transpose?()
答案:STRETCHWhichoneiswrongaboutcomplexnumbersinPython?()
答案:Boththerealandimaginarypartsareintegers.Whichoneistheoutputofthefollowingcode?tmp=eval("2+6")print(tmp)()
答案:8Whichoneistheoutputofthefollowingcode?foriin"butter":ifi=="t":breakprint(i)()
答案:nooutputWhichoneisthecorrectassignmentstatementinPython.()
答案:x=x-5*yWhichoneisnottheusageofPythoncomments()
答案:SpeedupcodeexecutionWhichoneiscorrectsyntaxforthe‘reshape()’functioninNumpy?()
答案:reshape(array,shape)Whichoneisattributeofimage?()
答案:format###size###modeWhichoneisalegalvariablename()
答案:name_schoolWhichonedescriptionofconditioninthefollowingsiscorrect?()
答案:Thecondition24<=28<25islegal,andtheoutputisFalseWhichonecouldbeusedtoopenafilec:\scores.txtforreading?()
答案:infile=open(“c:\\scores.txt”,“r”)Whichonecannotindicatethattherangeofxis(5,15).()
答案:x>5orx<15Whichofthefollowingstatementscannotcreateademo.txtfile?()
答案:f=open("demo.txt","r")Whichofthefollowingstatementsaretrue?()
答案:AllofthementionedWhichofthefollowingoperationswillrightlymodifythevalueoftheelement?()
答案:t=['h','e','l','l','o']t[0]='H'Whichofthefollowingisincorrect?()
答案:float("3+5")Whichofthefollowingisaninvalidvariable?()
答案:1st_stringWhichofthefollowingdictionarydefinitionwillreportanerror():()
答案:di={[1,3]:'a',[2,4]:'b'}Whichmannerdooperatorsperforminthesameprecedence?()
答案:LefttoRightWhichkeywordisusedtodefineafunctioninPython?()
答案:defWhichkeywordisusedtoaccesstheNumpypackageinPython?()
答案:importWhichistheoutputofthefollowingcode?a=30b=1ifa>=10:a=20elifa>=20:a=30elifa>=30:b=aelse:b=0print("a=",a,"b=",b)()
答案:a=20,b=1Whichisthecorrectoperatorforpower(Xy)?()
答案:X**yWhichisNOTthemainpartofcomputer()
答案:CacheWhichfunctionisnotthewayPythonreadsfiles.()
答案:readtext()WhicharethePythoninterpretertools?()
答案:PythonIDLE###ThonnyDLE###PyCharmDLE###JupyterNotebookWhicharetheadvantagesoffunctionsinPython?()
答案:Reducingduplicationofcode###Decomposingcomplexproblemsintosimplerpieces###Improvingclarityofthecode###EasiertomanagethecodeWhenwasPythonfirstreleased?()
答案:1991Whatwillbethevalueofxbytheexpressionx=int(43.55+2/2)?()
答案:44WhatwillbetheoutputofthefollowingPythonstatement?
>>>print('new''line')
()
答案:newlineWhatwillbetheoutputofthefollowingPythonexpression?4^12()
答案:8WhatwillbetheoutputofthefollowingPythonexpressionifx=22.19?print("%5.2f"%x)()
答案:22.19WhatwillbetheoutputofthefollowingPythoncode?veggies=['carrot','broccoli','potato','asparagus']veggies.insert(veggies.index('broccoli'),'celery')print(veggies)()
答案:[‘carrot’,‘celery’,‘broccoli’,‘potato’,‘asparagus’]WhatwillbetheoutputofthefollowingPythoncode?s1={1,2,3}s2={3,4,5,6}s1.difference(s2)s2.difference(s1)()
答案:{1,2}{4,5,6}WhatwillbetheoutputofthefollowingPythoncode?s=set([1,2,3])print(s.union([4,5]))print(s|([4,5]))()
答案:{1,2,3,4,5}ErrorWhatwillbetheoutputofthefollowingPythoncode?print("xyyzxyzxzxyy".endswith("xyy",0,2))()
答案:FalseWhatwillbetheoutputofthefollowingPythoncode?print("abc.DEF".capitalize())()
答案:DEFWhatwillbetheoutputofthefollowingPythoncode?numbers={}letters={}comb={}numbers[1]=56numbers[3]=7letters[4]='B'comb['Numbers']=numberscomb['Letters']=lettersprint(comb)()
答案:{‘Numbers’:{1:56,3:7},‘Letters’:{4:‘B’}}WhatwillbetheoutputofthefollowingPythoncode?not(3>4)not(1&1)()
答案:TrueFalseWhatwillbetheoutputofthefollowingPythoncode?lst=[3,4,6,1,2]lst[1:2]=[7,8]print(lst)()
答案:[3,7,8,6,1,2]WhatwillbetheoutputofthefollowingPythoncode?list(map((lambdax:x^2),range(10)))()
答案:[2,3,0,1,6,7,4,5,10,11]WhatwillbetheoutputofthefollowingPythoncode?list(map((lambdax:x**2),filter((lambdax:x%2==0),range(10))))()
答案:[0,4,16,36,64]WhatwillbetheoutputofthefollowingPythoncode?l=[1,2,3,4,5][x&1forxinl]()
答案:[1,0,1,0,1]WhatwillbetheoutputofthefollowingPythoncode?l=[-2,4]m=map(lambdax:x*2,l)print(m)()
答案:AddressofmWhatwillbetheoutputofthefollowingPythoncode?bool(‘False’)bool()()
答案:TrueFalseWhatwillbetheoutputofthefollowingPythoncode?a={i:'A'+str(i)foriinrange(5)}a()
答案:{0:‘A0’,1:‘A1’,2:‘A2’,3:‘A3’,4:‘A4’}WhatwillbetheoutputofthefollowingPythoncode?a={1:"A",2:"B",3:"C"}a.items()()
答案:dict_items([(1,‘A’),(2,‘B’),(3,‘C’)])WhatwillbetheoutputofthefollowingPythoncode?a=(1,2)b=(3,4)c=a+bprint(c)()
答案:(1,2,3,4)WhatwillbetheoutputofthefollowingPythoncode?not(10<20)andnot(10>30)()
答案:FalseWhatwillbetheoutputforthefollowingcode?importnumpyasnpa=np.array([1,2,3],dtype=complex)print(a)()
答案:[1.+0.j,2.+0.j,3.+0.j]Whatwillbeoutputforthefollowingcode?importnumpyasnpa=np.array([1,2,3,4,5],ndmin=2)printa()
答案:[[1,2,3,4,5]]Whatistheusangeofseek()methodinfiles?()
答案:setsthefile’scurrentpositionattheoffsetWhatistheusageofthezeros()functioninNumpyarray?()
答案:TomakeaMatrixwithallelement0Whatistheusageoftell()functioninPython?()
答案:tellsyouthecurrentpositionwithinthefileWhatistheresultoftheexpression,3*1**3?()
答案:3Whatistheresultoftheexpressionof2+4.00,2**4.0?()
答案:(6.0,16.0)Whatistheresultoftheexpression22%3?()
答案:1Whatistheoutputofprint(0.2==0.3)?()
答案:FalseWhatistheoutputoffollowingcodeprint([(a,b)forainrange(3)forbinrange(a)])()
答案:[(1,0),(2,0),(2,1)]WhatistheorderofnamespacesinwhichPythonlooksforanidentifier?()
答案:Pythonfirstsearchesthelocalnamespace,thentheglobalnamespaceandfinallythebuilt-innamespaceWhatistheeffectofImageFilter.CONTOUR?()
答案:ExtractlinesinthepictureWhatisavariabledefinedoutsideafunction?()
答案:AglobalvariableWhatdoesNumpy.array(list)do?()
答案:ItconvertlisttoarrayWhatarithmeticoperatorscannotbeusedwithstrings?()
答案:–Toreadtheentireremainingcontentsofthefileasastringfromafileobjectinfile,whichoneshouldbeused?()
答案:infile.read()TheoperationmodeofPythonincludes().()
答案:Interactiveoperation###ScriptedoperationTheintegrateddevelopmenttoolbuiltintoPythonis().
答案:IDLESupposethecontentofthetest.txtfileis?aaaabbbbccccTheoutputofthefollowingcodeisf=open("test.txt","r")print(f.readline(3))f.close()()
答案:aaaRegardingthebranchstructureofPython,whichoneiswrong?()
答案:ThebranchstructurecanjumptothepartofthestatementthathasbeenexecutedPythonuses___todenotecodeblocks.()
答案:IndentationPythonuses()asanescapecharactertodenotespecialusage.()
答案:\Pythonisa()language.()
答案:High-levellanguage###InterpretedlanguagePythonhastwobasicmodes()
答案:Script###InteractiveNumPyprovidesafunction__________tocreatesequencesofnumbers,.()
答案:arangeNumpyisathirdpartypackagefor____inPython?()
答案:ArrayIsitpossibletoconverttheNumpyarraytolistinPython?()
答案:YesInthefollowingoptions,theincorrectdescriptionis.()
答案:Whendefiningaclass,allpropertiesandmethodsoftheclassmustbedefinedHowtorenameafileinPython?()
答案:os.rename(existing_name,new_name)Howtogetthecurrentpositionwithinthefile?()
答案:fp.tell()HowtoconvertaNumpyarraytoalistinPython?()
答案:list(array)Howtochangethefilepositiontoanoffsetvaluefromthestart?()
答案:fp.seek(offset,0)Howdoesthevariablelengthargumentspecifiedinthefunctionheading?()
答案:onestarfollowedbyavalididentifierHowdorequiredargumentsspecifiedinthefunctionheading?()
答案:identifierHowdodefaultargumentsspecifiedinthefunctionheading?()
答案:identifierfollowedbyanequaltosignandthedefaultvalueGivencodebelow,whatshouldbetheoutput?s1=set(['a','b','r','c','d'])s2=set(['a','l','c','z','m'])print(len(s1&s2),len(s1^s2))()
答案:26Givencodebelow,whatshouldbetheoutput?nums=[10,20,30,40,50,60,70,80,90]some_nums=nums[2:-2]print(len(some_nums))()
答案:5Givencodebelow,whatshouldbetheoutput?mylist=[i**2foriinrange(5)]print(mylist[1])()
答案:1Givencodebelow,whatshouldbetheoutput?mylist=[34,56,29,73,19,62]mylist.insert(2,47)print(mylist[1:][3])()
答案:73Computersuse()forinformationprocessingandinformationstorage()
答案:BinarycodeCalculatethecubeofeachelementinl=[1,2,3,4,5,6,7
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 六一鋼琴活動策劃方案
- 液氯庫考試試題及答案
- 蘭州便利店開業活動方案
- 共青團植樹節活動方案
- 天車司機安全試題及答案
- 天津安全員證題庫題目及答案
- 面試題及答案分鐘
- 壓力焊考試試題及答案
- 關于興趣類小組活動方案
- 關于售后活動方案
- 高一語文暑假講義-初高銜接06:閱讀基本功句子含義的理解(教師版)
- 稅收政策與社會公平分配問題探討-洞察分析
- 2025屆安徽省合肥市重點中學中考二模生物試題含解析
- 森林生態旅游與康養基礎知識單選題100道及答案
- DB33T 2239-2020 經顱磁刺激戒毒康復應用管理規范
- 2025年陜西鋅業有限公司招聘筆試參考題庫含答案解析
- 露營地自然災害應急預案
- 醫療損害責任民法典
- 品管圈PDCA大賽作品-普外科提高腹腔鏡術后24小時內腸道通氣率醫院品質管理案例
- 智能交通信號控制系統維護方案
- 實驗室生物安全委員會及職責
評論
0/150
提交評論