2021知到答案 PYTHON语言程序设计(全英) 最新智慧树满分章节测试答案

第一章 单元测试

1、单选题:
Which is NOT the main part of computer ( )
选项:
A:Cache
B:memory
C:CPU
D:I/O equipment
答案: 【Cache】

2、多选题:
Which symbol can be used for comments in Python ( )
选项:
A:“
B:#
C:!
D://
答案: 【“ ;
#】

3、单选题:
The integrated development tool built into Python is ( ).
选项:
A:Pycharm
B:Vs code
C:Jupyter
D:IDLE
答案: 【IDLE】

4、单选题:
Which is the correct operator for power(Xy)? ( )
选项:
A:None of the mentioned
B:X**y
C:X^^y
D:X^y
答案: 【X**y】

5、单选题:
Which of the following is incorrect? ( )
选项:
A:float(4.2)
B:float(“3+5”)
C:float(3)
D:float(“3”)
答案: 【float(“3+5”)】

第二章 单元测试

1、单选题:
Which of the following is an invalid variable? ( )
选项:
A:1st_string
B:foo
C:my_string_1
D:_
答案: 【1st_string】

2、单选题:
What will be the output of the following Python code ? not(10<20) and not(10>30) ( )
选项:
A:No output
B:False
C:True
D:Error
答案: 【False】

3、单选题:
Which one will return error when accessing the list ‘l’ with 10 elements. ( )
选项:
A:l[10]
B:l[0]
C:l[-1]
D:l[-10]
答案: 【l[10]】

4、单选题:
What will be the output of the following Python code? lst=[3,4,6,1,2]lst[1:2]=[7,8]print(lst) ( )
选项:
A:[3, 7, 8, 6, 1, 2]
B:[3,[7,8],6,1,2]
C:Syntax error
D:[3,4,6,7,8]
答案: 【[3, 7, 8, 6, 1, 2]】

5、单选题:
Which of the following operations will rightly modify the value of the element? ( )
选项:
A:t={‘h’,’e’,’l’,’l’,’o’} t[0]=’H’
B:t=[‘h’,’e’,’l’,’l’,’o’] t[0]=’H’
C:s=’hello’ s[0]=’H’
D:t=(‘h’,’e’,’l’,’l’,’o’) t[0]=’H’
答案: 【t=[‘h’,’e’,’l’,’l’,’o’] t[0]=’H’】

6、单选题:
The following program input data: 95, the output result is?  (    )

选项:
A:Please enter your score: 95Awesome!Your ability exceeds 85% of people!
B:none of the mentioned
C:Please enter your score: 95Your ability exceeds 85% of people!
D:Please enter your score: 95Awesome!
答案: 【Please enter your score: 95Awesome!Your ability exceeds 85% of people!】

第三章 单元测试

1、单选题:
Which one description of condition in the followings is correct? ( )
选项:
A:The condition 24<=28<25 is legal, and the output is True
B:The condition 24<=28<25 is illegal
C:The condition 24<=28<25 is legal, and the output is False
D:The condition 35<=45<75 is legal, and the output is False
答案: 【The condition 24<=28<25 is legal, and the output is False】

2、单选题:
The output of the following program is? (   )

选项:
A:python
B:None
C:Python
D:t
答案: 【None】

3、单选题:
for var in ___: (   )

选项:
A:”Hello”
B:13.5
C:range(0,10)
D:[1,2,3]
答案: 【13.5】

4、单选题:
After the following program is executed, the value of s is?(   )

选项:
A:46
B:47
C:9
D:19
答案: 【9】

5、单选题:
Which is the output of the following code?a = 30b = 1if a >=10:a = 20elif a>=20:a = 30elif a>=30:b = aelse:b = 0print(“a=”,a,”b=”,b) ( )
选项:
A:a=20, b=20
B:a=30, b=1
C:a=20, b=1
D:a=30, b=30
答案: 【a=20, b=1】

第四章 单元测试

1、单选题:
Which keyword is used to define a function in Python? ( )
选项:
A:function
B:def
C:define
D:fun
答案: 【def】

2、单选题:
What will be the output of the following Python code?  (  )

选项:
A:x is 50Changed local x to 2x is now 50
B:None of the mentioned
C:x is 50Changed local x to 2x is now 2
D:x is 50Changed local x to 2x is now 100
答案: 【x is 50Changed local x to 2x is now 50】

3、多选题:
Which are the advantages of functions in Python? ( )
选项:
A:Easier to manage the code
B:Reducing duplication of code
C:Decomposing complex problems into simpler pieces
D:Improving clarity of the code
答案: 【Easier to manage the code;
Reducing duplication of code;
Decomposing complex problems into simpler pieces;
Improving clarity of the code】

4、单选题:
How does the variable length argument specified in the function heading? ( )
选项:
A:one star followed by a valid identifier
B:two stars followed by a valid identifier
C:two underscores followed by a valid identifier
D:one underscore followed by a valid identifier
答案: 【one star followed by a valid identifier】

5、单选题:
What will be the output of the following Python code? list(map((lambda x:x**2), filter((lambda x:x%2==0), range(10)))) ( )
选项:
A:[0, 4, 16, 36, 64]
B:No output
C:[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
D:Error
答案: 【[0, 4, 16, 36, 64]】

第五章 单元测试

1、单选题:
Which of the following statements cannot create a demo.txt file? ( )
选项:
A:f = open(“demo.txt”, “w”)
B:f = open(“demo.txt”, “a”)
C:f = open(“demo.txt”, “x”)
D:f = open(“demo.txt”, “r”)
答案: 【f = open(“demo.txt”, “r”)】

2、单选题:
After executing the following procedure, what content will be saved in the file?file=open(‘test.txt’, ‘wt+’)file.write(‘hello SCUT’)file.close()file=open(‘test.txt’, ‘at+’)file.write(‘hello world’)file.close() ( )
选项:
A:hello world
B:hello SCUThello world
C:hello SCUT hello world
D:hello SCUT world
答案: 【hello SCUThello world】

3、单选题:
Which function is not the way Python reads files. ( )
选项:
A:read()
B:readlines()
C:readline()
D:readtext()
答案: 【readtext()】

4、单选题:
How to rename a file in Python? ( )
选项:
A:os.set_name(existing_name, new_name)
B:os.rename(fp, new_name)
C:fp.name = ‘new_name.txt’
D:os.rename(existing_name, new_name)
答案: 【os.rename(existing_name, new_name)】

5、单选题:
What is the usage of tell() function in Python? ( )
选项:
A:tells you the current position within the file
B:tells you the file is opened or not
C:tells you the end position within the file
D:none of the mentioned
答案: 【tells you the current position within the file】

第六章 单元测试

1、单选题:
What will be the output of the following Python code? (   )

选项:
A:Runs normally, doesn’t display anything
B:Displays 0, which is the automatic default value
C:Reports error as display function requires additional argument
D:Reports error as one argument is required while creating the object
答案: 【Reports error as one argument is required while creating the object】

2、单选题:
What will be the output of the following Python code?  (  )

选项:
A:Error
B:‘Old’
C:Nothing is printed
D:‘New’
答案: 【‘Old’】

3、单选题:
What will be the output of the following Python code?  (   )

选项:
A:Exception is thrown
B:__main__
C:test
D:Demo
答案: 【__main__】

4、单选题:
Which one of the followings is not correct about Class hierarchy? ( )
选项:
A:Subclass can override the methods inherited from superclass
B:Subclass can have methods with same name as superclass
C:Subclass can inherit all attributes from superclass
D:Subclass can not add more behavior/methods
答案: 【Subclass can not add more behavior/methods】

5、单选题:
What will be the output of the following Python code?  (   )

选项:
A:0 0
B:0 1
C:Error, the syntax of the invoking method is wrong
D:Error because class B inherits A but variable x isn’t inherited
答案: 【0 1】

第七章 单元测试

1、单选题:
Numpy is a third party package for ____ in Python? ( )
选项:
A:Lambda function
B:Type casting
C:Function
D:Array
答案: 【Array】

2、单选题:
How to convert a Numpy array to a list in Python? ( )
选项:
A:list(array)
B:list.append(array)
C:array.list
D:list.array
答案: 【list(array)】

3、单选题:
Which keyword is used to access the Numpy package in Python? ( )
选项:
A:load
B:from
C:fetch
D:import
答案: 【import】

4、单选题:
Which one is correct syntax for the ‘reshape()’ function in Numpy? ( )
选项:
A:reshape(array,shape)
B:reshape(shape,array)
C:array.reshape(shape)
D:reshape(shape)
答案: 【reshape(array,shape)】

5、单选题:
What will be the output for the following code? import numpy as np a = np.array([1, 2, 3], dtype = complex) print(a) ( )
选项:
A:[[ 1.+0.j, 2.+0.j, 3.+0.j]]
B:[ 1.+0.j]
C:[ 1.+0.j, 2.+0.j, 3.+0.j]
D:Error
答案: 【[ 1.+0.j, 2.+0.j, 3.+0.j]】

第八章 单元测试<%

资源下载
下载价格5
江苏开放大学作业答案周末可以看广告免费
点点赞赏,手留余香 给TA打赏

AI创作

  • 游客 下载了资源 2021年公务员多省联考《申论》题(福建乡镇卷)及参考答案
  • u******* 下载了资源 江苏开放大学冲突管理060202计分BBS2
  • u******* 下载了资源 2024年春江苏开放大学冲突管理060202综合性大作业
  • 游客 下载了资源 2017年浙江公务员考试《行测》真题(A卷)答案及解析
  • u******* 下载了资源 2024年春江苏开放大学冲突管理060202综合性大作业
  • 游客 下载了资源 爱普生Epson Stylus C87 驱
  • 游客 下载了资源 2025年包钢集团招聘笔试参考题库含答案解析
  • 游客 下载了资源 爱普生Epson Stylus Photo EX3 打印机驱动
  • 游客 下载了资源 2015年重庆市公务员考试《行测》真题(下半年卷)答案及解析
  • u******* 下载了资源 江苏开放大学行政伦理学第二次计分BBS讨论
  • u******* 下载了资源 江苏开放大学行政伦理学第一次计分BBS讨论
  • u******* 下载了资源 2024年春江苏开放大学行政伦理学060197综合大作业
  • u******* 下载了资源 2024年春江苏开放大学行政伦理学060197综合大作业
  • 游客 下载了资源 爱普生Epson TM-H5200 驱动
  • 游客 下载了资源 2013年广东公务员考试《申论》真题卷及答案
  • 游客 下载了资源 爱普生Epson WorkForce Pro WF-5690 驱动
点击浏览器地址栏的⭐图标收藏本页
需要代写作业,论文扫码加微信
显示验证码

社交账号快速登录

微信扫一扫关注
扫码关注后会自动登录