给出下面代码:a= input( ).split( , )if isinstance(a,list):print( {} is list .format(a))else:print( {} is not list .format(a))代码执行时,从键盘获得1,2,3,则代码的输出结果是:()
A: A 执行代码出错
B: 1,2,3 is not list
C: ['1', '2', '3'] is list
D: 1,2,3 is list
A: A 执行代码出错
B: 1,2,3 is not list
C: ['1', '2', '3'] is list
D: 1,2,3 is list
举一反三
- 下面代码的输出结果是() vlist = list(range(5)) print() A: [0, 1, 2, 3, 4] B: 0;1;2;3;4; C: 0,1,2,3,4, D: 0 1 2 3 4
- 代码如下 #函数定义 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']
- 下面代码的输出结果是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;
- 程序段如下: x=[1,2,3] y=["a","b","c"] print(list(zip(x,y)))print函数输出的结果是( ) A: [( 'a':1), ('b:2), ('c':3)] B: [(1,2,3),("a","b","c")] C: [(1, 'a'), (2, 'b'), (3, 'c')] D: [{1:'a'}, {2:‘b'}, {3:'c'}]
- 下列代码的输出结果是(_____)。deffun():print(0)i=0whilei<3:i+=1yieldix=fun()y=(iforiinx)print(list(y))? [1,2,3]|[0,1,2,3]|0[1,2,3]|0123