代码 a = [ 1,2,3,4,5 ],以下输出结果正确的是?
A: print(a[:]) => [1,2,3,4]
B: print(a[0:]) => [2,3,4,5]
C: print(a[:100]) => [1,2,3,4,5]
D: print(a[-1:]) => [1,2]
A: print(a[:]) => [1,2,3,4]
B: print(a[0:]) => [2,3,4,5]
C: print(a[:100]) => [1,2,3,4,5]
D: print(a[-1:]) => [1,2]
举一反三
- 代码 a = [ 1,2,3,4,5 ],以下输出结果正确的是? A: print(a[:]) => [1,2,3,4] B: print(a[0:]) => [2,3,4,5] C: print(a[:100]) => [1,2,3,4,5] D: print(a[-1:]) => [1,2]
- count=5while(count>1): print(count,end="") count-=1输出是什么 A: 1 2 3 4 5 B: 2 3 4 5 C: 5 4 3 2 1 D: 5 4 3 2
- 下面代码的输出结果是() 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
- 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]
- 下列程序能输出几个数a = 5 if a>4: if a<3: print(1) else: print(2) else: if a<6: print(3) else: print(4) A: 1 B: 2 C: 3 D: 4