代码如下 #函数定义 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']
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']
举一反三
- 函数如下 defchanageList(list): list.append("end") print("list",list) #调用 strs=['1','2'] chanageList(strs) print("strs",strs) 下面对strs和list的值输出正确的是()。 A: strs list B: strs['1','2'] list['1','2'] C: list['1','2',’end’] strs['1','2',’end’] D: 运行运行有错误
- 下面对 strs 和 list 的值输出正确的是 A: strs ['1','2'] B: list ['1','2'] C: list ['1','2',’end’] D: strs ['1','2',’end’]
- 函数如下def chanageList(list):list.append(" end")strs =['ab','2']chanageList(strs)print("strs",strs)打印结果为()
- list=["a",1,"b",2]del list[1:3]print(list) A: ('a', 2) B: ['a'] C: ['a', 2] D: ['a', 'b']
- 下面代码的输出结果是vlist = list(range(5))for e in vlist: print(e,end=",") A: 0 1 2 3 4 B: 0,1,2,3,4, C: [0, 1, 2, 3, 4] D: 0;1;2;3;4;