list=["a",1,"b",2]del list[1:3]print(list)
A: ('a', 2)
B: ['a']
C: ['a', 2]
D: ['a', 'b']
A: ('a', 2)
B: ['a']
C: ['a', 2]
D: ['a', 'b']
举一反三
- list=[1,2,3],list[-1]的值为() A: 1 B: 3 C: 2 D: []
- dict={'a':1, 'b':2, 'c':3} str=list(dict.keys())[list(dict.values()).index(2)] print(str) 输出结果是( ) A: a B: C: c D: 2
- 代码如下 #函数定义 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']
- 函数如下 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: 运行运行有错误
- 补全代码,使输出结果为True Truea = 1b = "2"list = [1,2,3,4,5]print(a _____ list,b ____ list)