现有列表a = [1, 2, 3],b = [4, 5, 6],则a + b的值是什么?
A.[5, 7, 9]
B.[1, 2, 3, 4, 5, 6]
C.[1, 2, 3, [4, 5, 6]]
D.报错
查看答案
现有列表a = [1, 2, 3],如何将a拼接成字符串123?
A..join([str(i) for i in a])
B."".join(a)
C.str(a)
D."" + a
代码如下: a = [1, 2, 3] b = range(4) 则a + b的结果是?
A.[1, 2, 3, 0, 1, 2, 3]
B.[1, 2, 3, 1, 2, 3, 4]
C.[1, 2, 3, 1, 2, 3]
D.报错
a = [1, 2, 3],则执行 a += [1] 后a的内容是什么?
A.[1]
B.[1, 2, 3]
C.[1, 2, 3, 1]
D.报错
a = [1, 2, 3],则 a += 1 的结果是什么?
A.[1]
B.[1, 2, 3]
C.[1, 2, 3, 1]
D.报错