下面代码的执行结果是def change(mylist): mylist.append([1,2,3,4]) print(mylist) returnmylist = ["a","b","c"]change(mylist)print(mylist)
A: ['a', 'b', 'c', [1, 2, 3, 4]]['a', 'b', 'c', [1, 2, 3, 4]]
B: ['a', 'b', 'c', [1, 2, 3, 4]]
C: ['a', 'b', 'c', 1, 2, 3, 4]
D: ['a', 'b', 'c', 1, 2, 3, 4]['a', 'b', 'c', 1, 2, 3, 4]
A: ['a', 'b', 'c', [1, 2, 3, 4]]['a', 'b', 'c', [1, 2, 3, 4]]
B: ['a', 'b', 'c', [1, 2, 3, 4]]
C: ['a', 'b', 'c', 1, 2, 3, 4]
D: ['a', 'b', 'c', 1, 2, 3, 4]['a', 'b', 'c', 1, 2, 3, 4]
举一反三
- 4-9下面代码的执行结果是( )。 a= [1,2][br][/br]a.append(3)[br][/br]a.insert(3,[4,5])[br][/br]print(a) A: [1, 2, 3, [4, 5]] B: [1, 2, 3, 4, 5] C: [1, 2, [4, 5] , 3] D: [1, 2, 3, 4, 5, 3]
- 下面代码的输出结果是( )。 t=[1,2,3] s=tuple(t) print(t,s) A: [1, 2, 3] [1, 2, 3] B: (1, 2, 3) (1, 2, 4) C: [1, 2, 3] (1, 2, 3) D: (1, 2, 6)[1, 2, 3]
- 已知 vec = [[1,2], [3,4]],则表达式 [[row[i] for row in vec] for i in range(len(vec[0]))]的值为______________()_________。[/i] A: [1, 2, 3, 4] B: [[1, 2, 3], 4] C: [[1, 3], [2, 4]] D: [1, 2, [3, 4]]
- 代码如下: 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: 报错
- dict1={'a':1,'b':2,'c':3}dict1.update(a=4)print(dict1)运行结果为 A: {4:1,'b':2,'c':3} B: {'a':4,'b':2,'c':3} C: {'a':1,'b':2,'c':3,'a':4}