假设线性表list1=[1,2,5]和list2=[2,3,6].代码list1.addAll(list2)执行后,list1是__________.
A: [1,2,2,3,5,6]
B: [1,2,3,5,6]
C: [1,5]
D: [2]
A: [1,2,2,3,5,6]
B: [1,2,3,5,6]
C: [1,5]
D: [2]
举一反三
- 假设线性表list1=[1,2,5]和list2=[2,3,6].代码list1.addAll(list2)执行后,list2是__________. A: [1,2,2,3,5,6] B: [1,2,3,5,6] C: [1,5] D: [2] E: [2,3,6]
- 假设列表list1是[1, 2, 5]、列表list2是[2, 3, 6],执行list1.addAll(list2)后,list2是
- 执行下列代码后,变量list2的值将改变为哪个选项?[br][/br] list1 = [1, 2, 3] list2 = [] for element in list1: list2.append(element) list1 = [4, 5, 6] A: [1, 2, 3] B: [4, 5, 6] C: [1, 2, 3, 4, 5, 6] D: 没有;该代码无效
- 若有List=[2,5,1,7],执行语句List.insert(3,9),List中的值为_______。() A: [9, 2, 5, 1, 7] B: [2, 5, 1, 9, 7] C: [2, 5, 1, 7, 9] D: [2, 5, 1, 7, 3, 9]
- 代码如下 #函数定义 def chanageList(list): list.append(" end") print("list",list) #调用 strs =['1','2'] chanageList() print("strs",strs) 下面对 strs 和 list 的值输出正确的是 A: strs ['1','2'] list ['1','2'] B: strs ['1','2','end'] list ['1','2','end'] C: list ['1','2','end'] strs ['1','2','end'] D: list ['1','2','end'] strs ['1','2']