admin 发表于 2022-4-21 21:30:10

第4次形考(Python)(课程代码:3309067-浙江电大)

<div class="testpapertitle" style="color: rgb(0, 0, 0); font-family: &quot;Microsoft YaHei&quot;; font-size: medium; background-color: rgb(238, 243, 249);">第4次形考(Python)</div><div class="total" style="color: rgb(0, 0, 0); font-family: &quot;Microsoft YaHei&quot;; font-size: medium; background-color: rgb(238, 243, 249);">试卷总分:100</div><div class="testpaperpart" style="color: rgb(0, 0, 0); font-family: &quot;Microsoft YaHei&quot;; font-size: medium; background-color: rgb(238, 243, 249);"><br>客观题<span class="explain"></span></div><div class="testpaperpart" style="color: rgb(0, 0, 0); font-family: &quot;Microsoft YaHei&quot;; font-size: medium; background-color: rgb(238, 243, 249);">单选题(共22题,共66分)<span class="explain"><br>开始说明:<br>结束说明:</span></div><div style="color: rgb(0, 0, 0); font-family: &quot;Microsoft YaHei&quot;; font-size: medium; background-color: rgb(238, 243, 249);"><div class="questionnumber">1.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">如果传入对象类型与要求的不符合,会报( )异常。<br><input type="radio" name="rad_27cde42b-87ab-4de6-998d-0c71b3d2e5a6A" disabled="">A、ZeroDivisionError<br><input type="radio" name="rad_27cde42b-87ab-4de6-998d-0c71b3d2e5a6B" checked="" disabled="">B、TypeError<br><input type="radio" name="rad_27cde42b-87ab-4de6-998d-0c71b3d2e5a6C" disabled="">C、AttributeError<br><input type="radio" name="rad_27cde42b-87ab-4de6-998d-0c71b3d2e5a6D" disabled="">D、IOError<br></div></div><div class="questionnumber">2.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">Python中查看对象的属性或方法,返回对象的属性和方法列表的函数为( )。<br><input type="radio" name="rad_47244921-12f2-4ea0-baab-44de78976abdA" disabled="">A、help()<br><input type="radio" name="rad_47244921-12f2-4ea0-baab-44de78976abdB" checked="" disabled="">B、dir()<br><input type="radio" name="rad_47244921-12f2-4ea0-baab-44de78976abdC" disabled="">C、info()<br><input type="radio" name="rad_47244921-12f2-4ea0-baab-44de78976abdD" disabled="">D、check()<br></div></div><div class="questionnumber">3.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">如果分配了有限的资源,则应将释放这些资源的代码放置在( )代码块中。<br><input type="radio" name="rad_d1b050c5-61b2-4938-bc45-039d3414b72dA" checked="" disabled="">A、finally<br><input type="radio" name="rad_d1b050c5-61b2-4938-bc45-039d3414b72dB" disabled="">B、except<br><input type="radio" name="rad_d1b050c5-61b2-4938-bc45-039d3414b72dC" disabled="">C、else<br><input type="radio" name="rad_d1b050c5-61b2-4938-bc45-039d3414b72dD" disabled="">D、for<br></div></div><div class="questionnumber">4.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">以下查看Pandas的DataFrame对象a的属性信息的正确方法是哪个?( )<br><input type="radio" name="rad_f4abc061-5ffa-4802-b542-7c07c3883105A" disabled="">A、a.help()<br><input type="radio" name="rad_f4abc061-5ffa-4802-b542-7c07c3883105B" disabled="">B、a.dtypes()<br><input type="radio" name="rad_f4abc061-5ffa-4802-b542-7c07c3883105C" disabled="">C、a.head()<br><input type="radio" name="rad_f4abc061-5ffa-4802-b542-7c07c3883105D" checked="" disabled="">D、a.info()<br></div></div><div class="questionnumber">5.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">如果某个函数或方法可能会产生异常,但不想在当前函数或方法中处理这个异常,可以用( )语句在函数或方法中抛出异常。<br><input type="radio" name="rad_314aadc9-a306-4ed4-aabb-247b0517adf4A" disabled="">A、finally<br><input type="radio" name="rad_314aadc9-a306-4ed4-aabb-247b0517adf4B" disabled="">B、except<br><input type="radio" name="rad_314aadc9-a306-4ed4-aabb-247b0517adf4C" checked="" disabled="">C、raise<br><input type="radio" name="rad_314aadc9-a306-4ed4-aabb-247b0517adf4D" disabled="">D、catch<br></div></div><div class="questionnumber">6.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">在Python中,提供了( )语句来捕获并处理异常。<br><input type="radio" name="rad_84f95e0e-e832-43d5-8a31-ed1cdfb228bcA" checked="" disabled="">A、try-except<br><input type="radio" name="rad_84f95e0e-e832-43d5-8a31-ed1cdfb228bcB" disabled="">B、try-catch<br><input type="radio" name="rad_84f95e0e-e832-43d5-8a31-ed1cdfb228bcC" disabled="">C、try-for<br><input type="radio" name="rad_84f95e0e-e832-43d5-8a31-ed1cdfb228bcD" disabled="">D、try-error<br></div></div><div class="questionnumber">7.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">下列不属于Numpy数据类型的是( )。<br><input type="radio" name="rad_81d2eac0-5538-498c-87f2-35bf6dc3176eA" disabled="">A、int16<br><input type="radio" name="rad_81d2eac0-5538-498c-87f2-35bf6dc3176eB" disabled="">B、int32<br><input type="radio" name="rad_81d2eac0-5538-498c-87f2-35bf6dc3176eC" disabled="">C、int64<br><input type="radio" name="rad_81d2eac0-5538-498c-87f2-35bf6dc3176eD" checked="" disabled="">D、int128<br></div></div><div class="questionnumber">8.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">如果从父类继承的方法不能满足子类的需求,可以对其进行改写,这个过程叫方法的覆盖,也称为方法的( )。<br><input type="radio" name="rad_ed3dc876-eaad-4d9b-8e09-fd9affeb5cefA" checked="" disabled="">A、重写<br><input type="radio" name="rad_ed3dc876-eaad-4d9b-8e09-fd9affeb5cefB" disabled="">B、重载<br><input type="radio" name="rad_ed3dc876-eaad-4d9b-8e09-fd9affeb5cefC" disabled="">C、延伸<br><input type="radio" name="rad_ed3dc876-eaad-4d9b-8e09-fd9affeb5cefD" disabled="">D、加载<br></div></div><div class="questionnumber">9.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">Python中哪种标识符代表类的私有成员?<br><input type="radio" name="rad_90662aaf-8272-4fb9-9ca9-9aa18058f909A" disabled="">A、__test__<br><input type="radio" name="rad_90662aaf-8272-4fb9-9ca9-9aa18058f909B" disabled="">B、_test<br><input type="radio" name="rad_90662aaf-8272-4fb9-9ca9-9aa18058f909C" checked="" disabled="">C、__test<br><input type="radio" name="rad_90662aaf-8272-4fb9-9ca9-9aa18058f909D" disabled="">D、test__<br></div></div><div class="questionnumber">10.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">类属性可以通过类名称或者( )访问。<br><input type="radio" name="rad_4ac1265d-5c90-4f17-b869-3a494528916eA" checked="" disabled="">A、实例名称<br><input type="radio" name="rad_4ac1265d-5c90-4f17-b869-3a494528916eB" disabled="">B、函数名称<br><input type="radio" name="rad_4ac1265d-5c90-4f17-b869-3a494528916eC" disabled="">C、属性名称<br><input type="radio" name="rad_4ac1265d-5c90-4f17-b869-3a494528916eD" disabled="">D、任意名称<br></div><div style="font-family: 宋体, Arial;"></div><div style="font-family: 宋体, Arial;"><span style="font-family: &quot;Microsoft YaHei&quot;;">11.(3分)</span></div></div><div class="question"><div style="font-family: 宋体, Arial;">封装对象的属性和行为的载体是( )。<br><input type="radio" name="rad_a4c68eaa-51d5-4596-aff4-5ddbfe033355A" checked="" disabled="">A、类<br><input type="radio" name="rad_a4c68eaa-51d5-4596-aff4-5ddbfe033355B" disabled="">B、方法<br><input type="radio" name="rad_a4c68eaa-51d5-4596-aff4-5ddbfe033355C" disabled="">C、属性<br><input type="radio" name="rad_a4c68eaa-51d5-4596-aff4-5ddbfe033355D" disabled="">D、接口<br></div></div><div class="questionnumber">12.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">下列哪种调用模块的方式可以之后使用array() ?<br><input type="radio" name="rad_bb8d5716-5941-4c13-8f6c-8e4ceccf53baA" disabled="">A、import numpy<br><input type="radio" name="rad_bb8d5716-5941-4c13-8f6c-8e4ceccf53baB" disabled="">B、import numpy as np<br><input type="radio" name="rad_bb8d5716-5941-4c13-8f6c-8e4ceccf53baC" checked="" disabled="">C、from numpy import array<br><input type="radio" name="rad_bb8d5716-5941-4c13-8f6c-8e4ceccf53baD" disabled="">D、以上三种均不能<br></div></div><div class="questionnumber">13.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">Python使用关键字( )来定义类。<br><input type="radio" name="rad_43ef709f-ae82-4335-b8f3-bc52d40eb2abA" disabled="">A、def<br><input type="radio" name="rad_43ef709f-ae82-4335-b8f3-bc52d40eb2abB" disabled="">B、__init__<br><input type="radio" name="rad_43ef709f-ae82-4335-b8f3-bc52d40eb2abC" checked="" disabled="">C、class<br><input type="radio" name="rad_43ef709f-ae82-4335-b8f3-bc52d40eb2abD" disabled="">D、self<br></div></div><div class="questionnumber">14.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">实例方法创建完成后,可以通过类的实例名称和( )操作符进行访问。<br><input type="radio" name="rad_37309132-9981-4405-8664-e7de7f6773c1A" disabled="">A、/<br><input type="radio" name="rad_37309132-9981-4405-8664-e7de7f6773c1B" disabled="">B、@<br><input type="radio" name="rad_37309132-9981-4405-8664-e7de7f6773c1C" checked="" disabled="">C、.<br><input type="radio" name="rad_37309132-9981-4405-8664-e7de7f6773c1D" disabled="">D、*<br></div></div><div class="questionnumber">15.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">实例方法的第一个参数必须是( )。<br><input type="radio" name="rad_bc2e72a6-f82b-4cb4-ad78-0f3ad09f0e07A" disabled="">A、parameterlist<br><input type="radio" name="rad_bc2e72a6-f82b-4cb4-ad78-0f3ad09f0e07B" checked="" disabled="">B、self<br><input type="radio" name="rad_bc2e72a6-f82b-4cb4-ad78-0f3ad09f0e07C" disabled="">C、list<br><input type="radio" name="rad_bc2e72a6-f82b-4cb4-ad78-0f3ad09f0e07D" disabled="">D、statement<br></div></div><div class="questionnumber">16.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">如果try语句块中的代码没有错误,那么( )语句块将不会被执行。<br><input type="radio" name="rad_8a1d0f66-cbeb-4016-8f58-a42fa5906281A" disabled="">A、def<br><input type="radio" name="rad_8a1d0f66-cbeb-4016-8f58-a42fa5906281B" checked="" disabled="">B、except<br><input type="radio" name="rad_8a1d0f66-cbeb-4016-8f58-a42fa5906281C" disabled="">C、else<br><input type="radio" name="rad_8a1d0f66-cbeb-4016-8f58-a42fa5906281D" disabled="">D、for<br></div></div><div class="questionnumber">17.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">一段代码运行后出现IndentationError错误提示,它表示( )。<br><input type="radio" name="rad_894c0fb0-2083-4467-8caf-ff3346d72712A" disabled="">A、变量不存在<br><input type="radio" name="rad_894c0fb0-2083-4467-8caf-ff3346d72712B" disabled="">B、语法错误<br><input type="radio" name="rad_894c0fb0-2083-4467-8caf-ff3346d72712C" checked="" disabled="">C、缩进错误<br><input type="radio" name="rad_894c0fb0-2083-4467-8caf-ff3346d72712D" disabled="">D、索引超出范围<br></div></div><div class="questionnumber">18.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">类方法是指类对象所拥有的方法,一般用装饰器( )来标识。<br><input type="radio" name="rad_7c22969b-ae7d-4d13-8e57-0d98c1d9d502A" disabled="">A、@staticmethod<br><input type="radio" name="rad_7c22969b-ae7d-4d13-8e57-0d98c1d9d502B" disabled="">B、staticmethod<br><input type="radio" name="rad_7c22969b-ae7d-4d13-8e57-0d98c1d9d502C" checked="" disabled="">C、@classmethod<br><input type="radio" name="rad_7c22969b-ae7d-4d13-8e57-0d98c1d9d502D" disabled="">D、classmethod<br></div></div><div class="questionnumber">19.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">关于程序的异常处理,以下选项中描述错误的是( )。<br><input type="radio" name="rad_4b517d88-4678-49e1-b11b-a1884fdb8a71A" disabled="">A、程序异常发生经过妥善处理可以继续执行<br><input type="radio" name="rad_4b517d88-4678-49e1-b11b-a1884fdb8a71B" disabled="">B、异常语句可以与 else 和 finally 保留字配合使用<br><input type="radio" name="rad_4b517d88-4678-49e1-b11b-a1884fdb8a71C" disabled="">C、Python 通过 try、except 等保留字提供异常处理功能<br><input type="radio" name="rad_4b517d88-4678-49e1-b11b-a1884fdb8a71D" checked="" disabled="">D、编程语言中的异常和错误是完全相同的概念<br></div></div><div class="questionnumber">20.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">下列哪个方法用于查看类的属性?<br><input type="radio" name="rad_fc52b34f-bd09-464c-b5bc-e780b88d6cdcA" disabled="">A、__doc__<br><input type="radio" name="rad_fc52b34f-bd09-464c-b5bc-e780b88d6cdcB" checked="" disabled="">B、__dict__<br><input type="radio" name="rad_fc52b34f-bd09-464c-b5bc-e780b88d6cdcC" disabled="">C、__module__<br><input type="radio" name="rad_fc52b34f-bd09-464c-b5bc-e780b88d6cdcD" disabled="">D、__class__<br></div></div><div class="questionnumber">21.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">下面哪项特性不是面向对象程序设计的主要特征( )。<br><input type="radio" name="rad_7fdc6122-d8b5-4e53-a04f-7efa4f0ca125A" disabled="">A、封装<br><input type="radio" name="rad_7fdc6122-d8b5-4e53-a04f-7efa4f0ca125B" checked="" disabled="">B、函数<br><input type="radio" name="rad_7fdc6122-d8b5-4e53-a04f-7efa4f0ca125C" disabled="">C、多态<br><input type="radio" name="rad_7fdc6122-d8b5-4e53-a04f-7efa4f0ca125D" disabled="">D、继承<br></div></div><div class="questionnumber">22.(3分)</div><div class="question"><div style="font-family: 宋体, Arial;">Python在声明类的过程中定义属性时,带有( )的属性称为私有属性。<br><input type="radio" name="rad_0542030e-3b7a-4d95-bbdd-9e7b35e630b5A" checked="" disabled="">A、2个下划线的前缀<br><input type="radio" name="rad_0542030e-3b7a-4d95-bbdd-9e7b35e630b5B" disabled="">B、1个下划线的前缀<br><input type="radio" name="rad_0542030e-3b7a-4d95-bbdd-9e7b35e630b5C" disabled="">C、2个下划线的后缀<br><input type="radio" name="rad_0542030e-3b7a-4d95-bbdd-9e7b35e630b5D" disabled="">D、1个下划线的后缀<br></div></div></div><div class="testpaperpart" style="color: rgb(0, 0, 0); font-family: &quot;Microsoft YaHei&quot;; font-size: medium; background-color: rgb(238, 243, 249);">判断题(共12题,共24分)<span class="explain"><br>开始说明:<br>结束说明:</span></div><div style="color: rgb(0, 0, 0); font-family: &quot;Microsoft YaHei&quot;; font-size: medium; background-color: rgb(238, 243, 249);"><div class="questionnumber">23.(2分)</div><div class="question"><div style="font-family: 宋体, Arial;"><table witdh="100%"><tbody><tr><td>私有属性只能在类的内部进行调用,无法在类的外部访问。</td></tr><tr><td style="height: 10px;"></td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_cf3fafef-5050-4eed-a80f-4546c6ae24fc_T" disabled="">√</td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_cf3fafef-5050-4eed-a80f-4546c6ae24fc_F" checked="" disabled="">×</td></tr></tbody></table></div></div><div class="questionnumber">24.(2分)</div><div class="question"><div style="font-family: 宋体, Arial;"><table witdh="100%"><tbody><tr><td>静态方法一般通过类名调用,也可以通过对象调用。</td></tr><tr><td style="height: 10px;"></td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_1b24703d-9b0d-4f66-b4b9-bb3989ae0c9c_T" checked="" disabled="">√</td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_1b24703d-9b0d-4f66-b4b9-bb3989ae0c9c_F" disabled="">×</td></tr></tbody></table></div></div><div class="questionnumber">25.(2分)</div><div class="question"><div style="font-family: 宋体, Arial;"><table witdh="100%"><tbody><tr><td>类方法以self作为第一个参数。</td></tr><tr><td style="height: 10px;"></td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_175f29f7-e4f6-4261-a2ad-551d66c588d5_T" checked="" disabled="">√</td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_175f29f7-e4f6-4261-a2ad-551d66c588d5_F" disabled="">×</td></tr></tbody></table></div></div><div class="questionnumber">26.(2分)</div><div class="question"><div style="font-family: 宋体, Arial;"><table witdh="100%"><tbody><tr><td>使用@staticmethod装饰器修饰的方法称之为类方法。</td></tr><tr><td style="height: 10px;"></td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_c8039ef3-089b-43db-a65a-d16b015e44e0_T" disabled="">√</td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_c8039ef3-089b-43db-a65a-d16b015e44e0_F" checked="" disabled="">×</td></tr></tbody></table></div></div><div class="questionnumber">27.(2分)</div><div class="question"><div style="font-family: 宋体, Arial;"><table witdh="100%"><tbody><tr><td>使用try-except语句捕获异常后,当程序出错时,输出错误信息后程序会继续执行。</td></tr><tr><td style="height: 10px;"></td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_affa3ee3-3f38-490c-a02b-cee4e7a6a248_T" checked="" disabled="">√</td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_affa3ee3-3f38-490c-a02b-cee4e7a6a248_F" disabled="">×</td></tr></tbody></table></div></div><div class="questionnumber">28.(2分)</div><div class="question"><div style="font-family: 宋体, Arial;"><table witdh="100%"><tbody><tr><td>Numpy、Pandas、Matplotlib是使用Python语言从事数据分析的重要第三方库。</td></tr><tr><td style="height: 10px;"></td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_786d18fc-b3bf-446f-bf67-9efe9bc579dd_T" checked="" disabled="">√</td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_786d18fc-b3bf-446f-bf67-9efe9bc579dd_F" disabled="">×</td></tr></tbody></table></div></div><div class="questionnumber">29.(2分)</div><div class="question"><div style="font-family: 宋体, Arial;"><table witdh="100%"><tbody><tr><td>使用@classmethod装饰器修饰的方法称之为静态方法。</td></tr><tr><td style="height: 10px;"></td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_3cb95a77-8db6-4c90-883b-d4b5dff6d97d_T" disabled="">√</td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_3cb95a77-8db6-4c90-883b-d4b5dff6d97d_F" checked="" disabled="">×</td></tr></tbody></table></div></div><div class="questionnumber">30.(2分)</div><div class="question"><div style="font-family: 宋体, Arial;"><table witdh="100%"><tbody><tr><td>定义类时若没有指定基类,Python会默认继承object类,object是所有Python类的基类。</td></tr><tr><td style="height: 10px;"></td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_8b3599f1-71d4-4d85-9397-3d0ed2488fcd_T" checked="" disabled="">√</td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_8b3599f1-71d4-4d85-9397-3d0ed2488fcd_F" disabled="">×</td></tr></tbody></table></div></div><div class="questionnumber">31.(2分)</div><div class="question"><div style="font-family: 宋体, Arial;"><table witdh="100%"><tbody><tr><td>Python与Java相似,类的继承只能是单继承。</td></tr><tr><td style="height: 10px;"></td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_c682c5fb-79b5-4e01-b282-0a07bfedb91f_T" disabled="">√</td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_c682c5fb-79b5-4e01-b282-0a07bfedb91f_F" checked="" disabled="">×</td></tr></tbody></table></div></div><div class="questionnumber">32.(2分)</div><div class="question"><div style="font-family: 宋体, Arial;"><table witdh="100%"><tbody><tr><td>如果需要同时处理多个异常,也可以在except语句后面使用一对小括号将可能出现的异常名称括起来。</td></tr><tr><td style="height: 10px;"></td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_f514e1c1-a14e-4d7b-bbbe-1580fceebc94_T" checked="" disabled="">√</td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_f514e1c1-a14e-4d7b-bbbe-1580fceebc94_F" disabled="">×</td></tr></tbody></table></div></div><div class="questionnumber">33.(2分)</div><div class="question"><div style="font-family: 宋体, Arial;"><table witdh="100%"><tbody><tr><td>一个类只能创建出一个实例。</td></tr><tr><td style="height: 10px;"></td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_92946646-e92c-42aa-8ce7-f2846ba06a2f_T" disabled="">√</td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_92946646-e92c-42aa-8ce7-f2846ba06a2f_F" checked="" disabled="">×</td></tr></tbody></table></div></div><div class="questionnumber">34.(2分)</div><div class="question"><div style="font-family: 宋体, Arial;"><table witdh="100%"><tbody><tr><td>不能在类外通过类对象访问私有的类属性。</td></tr><tr><td style="height: 10px;"></td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_c54a7a7d-d0b9-4faf-bae9-6e6fa2a4214c_T" checked="" disabled="">√</td></tr><tr><td style="height: 25px;"><input type="radio" name="rad_c54a7a7d-d0b9-4faf-bae9-6e6fa2a4214c_F" disabled="">×</td></tr></tbody></table></div></div></div><div class="testpaperpart" style="color: rgb(0, 0, 0); font-family: &quot;Microsoft YaHei&quot;; font-size: medium; background-color: rgb(238, 243, 249);">程序阅读题(共2题,共10分)<span class="explain"><br>开始说明:<br>结束说明:</span></div><div style="color: rgb(0, 0, 0); font-family: &quot;Microsoft YaHei&quot;; font-size: medium; background-color: rgb(238, 243, 249);"><div class="questionnumber">35.(5分)</div><div class="question"><div style="font-family: 宋体, Arial;">以下程序运行的结果是( )。<br>try:<br>&nbsp;&nbsp;&nbsp;&nbsp;1/0<br>except Exception as e:<br>&nbsp;&nbsp;&nbsp;&nbsp;print ("0不能作为除数")<br>else:<br>&nbsp;&nbsp;&nbsp;&nbsp;print ("没有异常")<br>finally:<br>&nbsp;&nbsp;&nbsp;&nbsp;print ("最后总是要执行我")<br><input type="radio" name="rad_82cb20f0-cbe3-4cb0-852b-246b5fdbc530A" disabled="">A、0不能作为除数<br><input type="radio" name="rad_82cb20f0-cbe3-4cb0-852b-246b5fdbc530B" disabled="">B、最后总是要执行我<br><input type="radio" name="rad_82cb20f0-cbe3-4cb0-852b-246b5fdbc530C" disabled="">C、没有异常<br><input type="radio" name="rad_82cb20f0-cbe3-4cb0-852b-246b5fdbc530D" checked="" disabled="">D、0不能作为除数最后总是要执行我<br></div></div><div class="questionnumber">36.(5分)</div><div class="question"><div style="font-family: 宋体, Arial;">运行下面这句代码,会引发什么异常?( )<br>print(10/0)<br><input type="radio" name="rad_96ec79c2-42ee-4f0b-9107-37b04c0a327aA" checked="" disabled="">A、ZeroDivisionError<br><input type="radio" name="rad_96ec79c2-42ee-4f0b-9107-37b04c0a327aB" disabled="">B、SyntaxError<br><input type="radio" name="rad_96ec79c2-42ee-4f0b-9107-37b04c0a327aC" disabled="">C、AttributeError<br><input type="radio" name="rad_96ec79c2-42ee-4f0b-9107-37b04c0a327aD" disabled="">D、IOError</div><div style="font-family: 宋体, Arial;"></div></div></div><p></p>
页: [1]
查看完整版本: 第4次形考(Python)(课程代码:3309067-浙江电大)