第一章 单元测试

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!

发表评论

电子邮件地址不会被公开。 必填项已用*标注