智慧树知到答案PYTHON语言程序设计(全英)最新答案

资源下载
下载价格15

第一章 单元测试

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
答案: 【】

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

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

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

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

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

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

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
答案: 【】

第四章 单元测试

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

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
答案: 【】

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
答案: 【】

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
答案: 【】

第五章 单元测试

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”)
答案: 【

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
答案: 【

3、单选题:
Which function is not the way Python reads files. ( )
选项:
A:read()
B:readlines()
C:readline()
D: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)
答案: 【

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
答案: 【

第六章 单元测试

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
答案: 【

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

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

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

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

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
答案: 【

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
答案: 【

第七章 单元测试

1、单选题:
Numpy is a third party package for ____ in Python? ( )
选项:
A:Lambda function
B:Type casting
C:Function
D: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
答案: 【

3、单选题:
Which keyword is used to access the Numpy package in Python? ( )
选项:
A:load
B:from
C:fetch
D: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)
答案: 【

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、单选题:
Which one isn’t the method of Image.transpose? ( )
选项:
A:TRANSPOSE
B:FLIP_LEFT_RIGHT
C:ROTATE_90
D:STRETCH
答案: 【

2、单选题:
Which one isn’t the method of ImageFilter? ( )
选项:
A:ImageFilter.EDGE_ENHANCE
B:ImageFilter.BLUR
C:ImageFilter.SHARP
D:ImageFilter.DETAIL
答案: 【

3、多选题:
Which one is attribute of image? ( )
选项:
A:mode
B:format
C:size
D:color
答案: 【

4、单选题:
Which operation can be used to set the picture to a given size? ( )
选项:
A:thumbnail()
B:crop()
C:transpose()
D:resize()
答案: 【

5、单选题:
What is the effect of ImageFilter. CONTOUR? ( )
选项:
A:Sharp the image
B:Blur the picture
C:Smooth the picture
D:Extract lines in the picture
答案: 【

0
觉得这篇文章对你有用的话,就打赏一下支持文章作者

评论0

请先

站点公告

开放大学课程作业代写,有需要扫码加微信

显示验证码

社交账号快速登录