大学MOOC 程序设计及应用(Python)(英)(西南财经大学)1462750173 最新慕课完整章节测试答案
Week14Try..exception..lambda..exercise
Oneshortmocktest
1、单选题:
Which of the following cannot be a variable?
选项:
A: __init__
B: in
C: it
D: on
答案: 【 in】
2、单选题:
Which of the following is an invalid statement?
选项:
A: abc = 1,000,000
B: a b c = 1000 2000 3000
C: a,b,c = 1000, 2000, 3000
D: a_b_c = 1,000,000
答案: 【 a b c = 1000 2000 3000】
3、单选题:
s='{0}, {1}, and {2}'
s.format('hello', 'good', 'morning')
选项:
A: good, hello, morning'
B: ‘hello, good, morning’
C: ‘hello, good, and morning’
D: Error
答案: 【 ‘hello, good, and morning’】
4、单选题:
i = 0
while i < 3:
print(i)
i += 1
else:
print(0)
选项:
A: 1 2 0
B: 0 1 2 0
C: 0 1 2
D: Error
答案: 【 0 1 2 0】
5、单选题:
for i in [1, 2, 3, 4][::-1]:
print (i)
选项:
A: 1 2 3 4
B: 4 3 2 1
C: error
D: none of the mentioned
答案: 【 4 3 2 1】
6、单选题:
What is the data type of (1)?
选项:
A: tuple
B: int
C: list
D: both tuple and int
答案: 【
