雨课堂学堂在线学堂云《Python programming basics and project practices(重庆工商职业学院)》单元测试考核答案_第1页
雨课堂学堂在线学堂云《Python programming basics and project practices(重庆工商职业学院)》单元测试考核答案_第2页
雨课堂学堂在线学堂云《Python programming basics and project practices(重庆工商职业学院)》单元测试考核答案_第3页
雨课堂学堂在线学堂云《Python programming basics and project practices(重庆工商职业学院)》单元测试考核答案_第4页
雨课堂学堂在线学堂云《Python programming basics and project practices(重庆工商职业学院)》单元测试考核答案_第5页
已阅读5页,还剩17页未读 继续免费阅读

下载本文档

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

文档简介

第1题ThefollowingisnotafeatureofPython:()AEasytolearnBOpen-sourceandfreeCLow-levelprogramminglanguageDHighportability第2题Inthefollowingoptions,()isnotaconstant.A'python'B8.25CpythonDTrue第3题ThestatementthatisincorrectaboutPythonmemorymanagementis:AVariablesdonotneedtobedeclaredinadvance.BVariablescanbeuseddirectlywithoutcreatingandassigningthemfirst.CVariablesdonotneedtospecifyatype.DResourcescanbereleasedusingdel.第4题Inthefollowingoptions,thebooleanvalueof()isnotFalse.ANoneB0C()D1第5题Incomputers,informationprocessingandstoragearedoneusing()ABinarycodeBDecimalcodeCHexadecimalcodeDASCIIcode第6题ThewayPythonsourcecodeisexecutedis()ACompiledexecutionBParsingexecutionCDirectexecutionDCompile-as-you-goexecution第7题Whichofthefollowingstatementsisincorrect?AAllstandardobjectsexceptdictionarytypescanbeusedforBooleantesting.BThebooleanvalueofanemptystringisFalse.CThebooleanvalueofanemptylistobjectisFalse.DThebooleanvalueofanynumberobjectwithavalueof0isFalse.第8题Thefollowingidentifiersarevalid:AhelloWorldB2ndObjChello#worldD_helloworld第9题Thefollowingsymbolrepresentsasingle-linecommentinPython:().A#B//CD"“"第10题Ifa=9andb=2,whichofthefollowingoperationsisincorrect?AThevalueofa+bis11B

Thevalueofa//bis4CThevalueofa%bis1DThevalueofa**bis18第11题ThefollowingdatatypesarenotsupportedinPython:AintBcharCfloatDdicitionary第12题WhichofthefollowingstatementsaboutcomplexnumberssinPythonisincorrect?AThesyntaxforrepresentingacomplexnumberisreal+imagejBBoththerealandimaginarypartsarefloating-pointnumbersCTheimaginarypartmustbesuffixedwithjandmustbelowercaseDThemethodconjugatereturnsthecomplexconjugateofacomplexnumber第13题Whichofthefollowingstatementsaboutstringsisincorrect?ACharactersshouldbeconsideredasstringsoflength1BStringsareterminatedbythe'\0'characterCStringscanbecreatedusingeithersinglequotesordoublequotesDSpecialcharacterssuchasnewlineandcarriagereturncanbeincludedintriple-quotedstrings第14题InPythonexpressions,()canbeusedtocontroltheorderofoperations.。A()B[]C{}D

第15题Pythonlanguagebelongsto()AMachinelanguageBAssemblylanguageChigh-levellanguage.DScientificcomputinglanguage第16题()Thebuilt-infunctionopen()cancorrectlyopenafileaslongasthefilepathiscorrect.第17题()Pythonusesautomaticmemorymanagementbasedonvalues.第18题()Samevaluesarenotalwayskeptinmemoryatthesametime.第19题()Pythondoesnotallowkeywordstobeusedasvariablenames.第20题()IfcannotbeusedasavariablenameinPython.第21题()ChinesecharacterscanbeusedasvariablenamesinPython3.x.第22题()Pythonvariablenamesmuststartwithaletterorunderscoreanddistinguishbetweenuppercaseandlowercaseletters.第23题()Theadditionoperatorcanbeusedtoconcatenatestringsandgeneratenewstrings.第24题()0o12fisnotavalidoctalnumber.第25题()OxadisavalidhexadecimalnumberrepresentationinPython.第26题()314jisavalidPythonnumerictype.第27题()TherearemultiplewaystocommentcodeinPython,notjustusingthecaretsymbol.第28题()Listscannotbeusedaskeysindictionaries.第29题()Tuplescanbeusedaskeysindictionaries.第30题()Theadditionoperator+inPython3.xcanperformnumericaladdition,stringconcatenation,listandtupleconcatenation,andsetunionoperations,butitcannotmergelistsandtuplesorperformsetunionoperations.第1题Thedescriptionerrorabouttheroleofthefunctionis().AStructuringprogrammingisthemostbasicencapsulationofcode,generallyorganizingaparagraphofcodeaccordingtofunction.BThepurposeoftheencapsulationistoreuseandreducethecode.CThecodeismorebeautifulandeasytoread.DNoneoftheaboveiscorrect第2题Pythonscriptfileisextendedasthe().ApythonBpyCptDpg第3题Inthetransferoffunctionparameters,thedescriptionofthe().Apythonimplementsthesafetyvaluetransferparameter,whichreferstothevalueoftheconstantvariable(realreference)whencallingthefunction.BRealparticipationparametersarestoredintheirrespectivememoryspaceandaretwounrelatedindependentvariables.CChangethevalueoftheshapeparameterwithintheparameter,andthevalueoftherealparametergenerallydoesnotchange.DThenameoftherealparticipationparametersmustbethesame.第4题The()functionisafunctionthatdirectlyorindirectlycallsthefunctionitselfArecurrenceBclosureClambdaDanonymous第5题Usethe()functiontoreceivetheinputdatausedAaccept()Binput()Creadline()Dlogin()第6题Regardingthedescriptionoftherecursivefunction,thecorrectoneinthefollowingoptionsisthe()AThefunctionnameservesasthereturnvalueBcontainsacircularstructureCFunctionsaremorecomplexDThefunctioncontainsasecondcalltothefunction第7题InPython,regardingthedescriptionofthefunction,thecorrectoneinthefollowingoptionsisthe()AThefunctioneval()canbeusedfornumericalexpressionevaluation,suchaseval("2*3+1")BPythonNotypeisspecifiedinthefunctiondefinition,whichmeansthattheparametercanberegardedasarbitraryinthefunction!makeuseofCOnlyonereturnstatementisallowedinafunctionDPython,defandreturnarethereservedwordsthatafunctionmustuse第8题Assumingthatglobalreservedwordsarenotincludedinthefunction,forthemethodtochangetheparametervalue,thefollowingoptionerroris()AChangethevalueoftheoriginalparameterwhentheparameteristhelisttypeBWhentheparameterisacombinationtype(variableobject),changethevalueoftheoriginalparameterCWhetherthevalueoftheparameterchangesisrelatedtotheoperationofthevariableinthefunction,regardlessoftheparametertypeDWhentheparameterisanintegertype,thevalueoftheoriginalparameterisnotchanged第9题Pythonbuilt-infunction,canreturnthelengthofobjects(characters,lists,tuples,etc.)orthenumberofitems()AdescribeBintClongDlen第10题The()isnotincludedinthefunctiondefinitionformatAkeywordsdefBfunctionnameCactualparameterDfunctionbody第11题Thefollowingstatementthatisincorrectisthatthe()AWhendefiningAfunction,theparameterofafunctiondoesnotrepresentanyspecificvalue,andonlywhenafunctioncalls,aspecificvalueisassignedtotheparameter.BTherandommodulemayget100byusingthefunctionrandint(1,100)CFunctionisawayofcodemultiplexingDThefunctionmustcontainaretur第12题Thefollowingincorrectstatementofthepythonfunctionisthe()TheApythonfunctiondoesnotrequirethefunctionnameTheBpythonfunctiondoesnotrequiredtospecifyaparameterdatatypeThereturnvalueoftheCpythonfunctioncanbemultipleThekeyworddefinedbytheDpythonfunctionisthedef第13题Inthefollowingoptions,thefunctiondefinitionerroristhe()Adefvfunc(*a,b)Bdefvfunc(a,b)Cdefvfunc(a,*b)Ddefvfunc(a,b=2)第14题PythonUnsupportedparametertype()AlocationparameterBDefaultparametersCvariableDTheinvariantparameter第15题ThebasicPythonbuilt-infunctioneval()is()A.Afloating-pointnumberB.RemovethestringBPythonexpressionevaluationC.CalculatethestringChexcharacterstringDtoEfromthemostlateralquotationmarksandreturnitsvalueasFasthevalueforthePythonstatementD.ConvertanintegerGto正确答案:G第16题()ThereturnvaluetypeofaPythonfunctiondoesnotneedtobespecifiedwhendefiningthefunction.第17题()Thereturnstatementinafunctionmaynotalwaysbeexecuted.第18题()ItisnotnecessarytodeclarethetypeoffunctionparameterswhendefiningafunctioninPython.第19题()Thenumberofactualargumentspassedwhencallingafunctiondoesnotnecessarilyhavetomatchthenumberoffunctionparameters.第20题()PositionalargumentsinPythonrefertopassingargumentstoafunctionwithoutanyadditionalexplanation,withmultipleactualargumentspassedsequentiallytocorrespondingformalparameters.Thenumberandorderofactualandformalparametersmustcorrespondexactly,otherwiseanexceptionwillbethrown.第21题()DefaultvalueparametersinPythonrefertosettingdefaultvaluesforsomeformalparameterswhendefiningafunction,andifactualargumentsarenotpassedfortheformalparametersthathavedefaultvalueswhencallingthefunction,thedefaultvaluesareused;ifactualargumentsarepassed,thoseargumentsareusedinstead.第22题()Onceafunctionisdefined,itcanbecalledanywhereintheprogram.第23题()Formalparametersareoptional,meaningafunctioncanincludeparametersornot,andmultipleformalparametersareseparatedbycommas.第24题()Functionsdonotnecessarilyimprovecodeexecutionspeed.第25题()Functionnamesfollowprogrammingconventions,startingwithalowercaseletterorunderscorefollowedbyanylengthofletters,numbers,underscores,etc.toformavalidfunctionname.第26题()Thefunctionbodyconsistsofaseriesofstatementsendingwithacolon,andtheremustbesomeindentationspacebetweenlineswithinthefunctionbodytoindicatethattheybelongtothefunctionbody.第27题()Keywordargumentscannotbepassedinanyorderandcannotbeomitted.第28题()Functionscanreturnvaluesofanytypetothecaller.第29题()Afunctioncallneedstoprovidetherequiredargumentsforthefunction,andthenumberofargumentsmustmatchthenumberdeclaredinthefunctiondefinition.第30题()Ifafunctiondoesnothaveareturnstatementorthereturnstatementdoesnothaveanyreturnvalue,thereturnvalueofthefunctionisNone.Practice3第1题Whichofthethreemajorobject-orientedfeaturesdoesnotincludethisfollowing?()ApackageBpolymorphicCconstructDinheritance第2题HowdoyoudefinetheprivatemethodinthePythonclass?()AAddprivatemodificationbeforemethodBAddtwounderlined__beforemethodCdeclarethefirstparametersettingofthemethodasselfDUseonlyprivatevariablesinthemethod第3题WhichofthefollowingstatementsistrueabouttheclassandinstancepropertiesofPython?()AClasspropertiescanbeaccessedbytheclassnameorinstancename.BClasspropertiescanbemodifiedbyeithertheclassnameorthepropertyname.CInstancepropertiescanbeaccessedthroughtheclassnameorinstancename.DInstancepropertiescanbemodifiedbytheclassnameorinstancename.第4题Whichofthefollowingcodedefinesthenameclasspropertycorrectly?()AclassMeeting:name="cqtbi"BclassMeeting:def__init__(self,name):=name;CclassMeeting:def__init__(self,id):name="cqtbi";DclassMeeting:="cqtbi"第5题PythonWhichkeywordisusedintheclassdeconstructionmethodinobject-orientedprogramming?()A__del__B__finish__C__delete__D__finalize__第6题Isthistherightwaytointroducethecustommodule?()Afrom

my_moduleimport

Studenttom=

my_module.Student('001',

'tom')

Bfrom

my_moduleimport

Studenttom=

Student('001',

'tom')

Cimport

my_moduletom=

Student('001',

'tom')Dimport

my_module.Studenttom=

Student('001',

'tom')第7题WhichofthefollowingstatementsiswrongabouttheparametersofthePythonfunction?()APositionparameterscannotbepassedmoreorless.BParameterswiththedefaultvaluesarethekeywordparameters.CTheindefinitelengthparametersshouldbeplacedattheendoftheparameterlist.DThedefaultparametersmustbeplacedbehindthepositionparameters.第8题Whichofthefollowinglambdaexpressionscorrectlydefinesanadditionfunction?Alambda

x,y:x+yBlambda(x,

y):

x+

yClambda

x,

y:

return

x+

yDlambda

x,

y=x+

y第9题Whichofthefollowingstandardmodulescanoperateonthefile?()AosBtimeCrandomDre第10题WhichofthefollowingregularexpressionsmatchestheIDcardnumber?()A\d[17]{\d|x|X}B\d{17}[\d|x|X]C\b[17]{\b|x|X}DCan't第11题IntheJavalanguage,0.6321isdataoftypefloat.()第12题re.searchThemethodscanstheentirestringandreturnsallsuccessfulmatches.()第13题Thederivedclassautomaticallycallstheconstructorofthebaseclass.()第14题PythonTopreferentiallyfindthecorrespondingmethodinthebaseclass,thebaseclassisnotfoundinthederivedclass.()第15题Theformalparameterofafunctionistheparameterdeclaredinparentheseswhendefiningafunction.()第16题Usingkeywordparameters,youcancallthemwithoutpassingthesequence.()第17题Whenyouusetheindefinitelengthparameter*argsintheparameterlist,theparametersareautomaticallyorganizedintoadictionaryincoming.()第18题ThePythonmoduleisessentiallyaPythonscriptfilethatcancontainvariables,functions,andclasses.()第19题Generatorsarespecialiteratorsthatexecutefromscratchoneverycall.()第20题TodefineafunctioninPython,youmustendwithreturnasthefunction.()Practice4第1题Whichofthefollowingcommandsistoinstallthird-partylibrariesinaPythondevelopmentenvironment?()AsetupByuminstallCpipinstallDimport第2题Whenusingawebcrawlertocrawldata,whatdoestheserverreturn503mean?()APagenotfoundBDeniedaccesstoCServerErrorDPageredirection第3题Inordertoallowthecrawlertoaccesstheserver,whichofthefollowingrequestheadsisusuallyrequired?()AAcceptBConnectionCUser-AgentDReferer第4题Ifyouneedtoopenafiletoreadandwrite,andifthefiledoesnotexist,whichreadandwritemodeisused?()ArBr+CwDw+第5题WhatistheXPATHsyntaxforgettingthenameofthedog(karl)oftypeHuskycorrectly,forthefollowingHTML?(B)<html>

<animal>

<dog

type="Husky">karl</dog>

<dog

type="Bulldog">momo</dog>

</animal>

</html>A//dog/@type="Husky"/textB//dog[@type="Husky"]/text()C//dog/@type="Husky"D/dog/@type="Husky"/text()第6题Whichofthefollowingerrorsdoestheserverreturn,usuallytriggeringthebackcrawlmechanism?()A301B403C503D200第7题Usingthecrawlertocrawltheserverdata,whichofthefollowingdocumentsshouldfollow?()Ahost.txtBrobots.txtCrule.txtDallow.txt第8题InPython,whichfunctionofpymyslisusedtoconnecttotheMySQLdatabase?()AopenBconnectCcreateDget第9题Whichofthefollowingthird-partymodulesiscommonlyusedforPythondataanalysis?()APandas

BScrapyCBeautifulSoupDlxml第10题WhenyouneedtowriteChinesetoafile,whichofthefollowingparametersisusuallyaddedwhenopeningthefile?()AenforceBencodingCdecodeDlocalization第11题Thesuccessofwebscrapingcanbedeterminedbycheckingthecodeattributeoftheresponseobject.()第12题InPython,theopenfunctionisusedtoopenfiles,andthefilemodesusuallyinclude"r","w","a","x",etc.()第13题Usingthe"r+"modetoopenafilemeansthatyoucanreadfromitaswellasappendcontent.(()第14题CSVfilestypicallyusethetabcharacter\ttoseparatedifferentfieldsinarow.()第15题Bydefault,Pythonopensfilesinbinaryformat.()第16题Whenafileisopenedusingthewithkeyword,youdonotneedtomanuallycalltheclosemethod.()第17题XMLdocumentswitherrorscannotbeparsedusinglxml.()第18题Whenthecontentofafileisverylarge,weshouldusetheread()methodtoreadit.()第19题Whenwritingtoafileusingthefile.write()function,youneedtomanuallyaddanewlinecharacterattheendoftheline.()第20题Usingbuilt-instandardlibrariesinPythondoesnotrequireimportingthem.()Practice5第1题InregularexpressionmatchinginPython,thedefaultmodeisgreedy.

()第2题Lambdaexpressionsareoftenusedtowritefunctionsthatneedtobecalledrepeatedly.

(

)第3题Thekeyof3Ddynamicfacerecognitiontechnologyliesinusinghigh-precision3Dfull-facecameratoobtainthethree-dimensionalgeometricfeaturesandblack-and-whitetexturefeaturesoftheface.(

)第4题Errorsencounteredwhenwritingprogramscanberoughlydividedintotwocategories:syntaxerrorsandruntimeerrors.()第5题InXPath,anXMLdocumentistreatedasanodetree,andtherootofthetreeiscalledtherootnode.

()第6题

PressF10onthebrowserpagetoopendevelopermode.

(

)第7题Therobotsprotocolisusedtotellwebsiteshowtoidentifyvisitorsaseitherhumanorrobot(application).()第8题Thevalueoftheexpressionlen(range(1,9))is9.

(

)第9题InPythonprogramming,theexceptionsthatarethrownbyyourselfarecalledcustomexceptions.

()第1

温馨提示

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

评论

0/150

提交评论