表达式 list(range(8,0,-2)) 的值是: ________
A: [8,
6, 4, 2]
B: [2,4,6,8]
C: [8,6,4,2,0]
D: [0,2,4,6,8]
A: [8,
6, 4, 2]
B: [2,4,6,8]
C: [8,6,4,2,0]
D: [0,2,4,6,8]
举一反三
- 以下代码的输出结果是()for i in range(0,10,2): print(i,end="") A: 0 2 4 6 8 B: 2 4 6 8 C: 0 2 4 6 8 10 D: 2 4 6 8 10
- set1 = {x for x in range(10) if x%2==0} print(set1) 以上代码的运行结果为? A: {0, 2, 4, 6} B: {2, 4, 6, 8} C: {0, 2, 4, 6, 8} D: {4, 6, 8}
- list(range(-1,10,2)) A: [0, 2, 4, 6, 8, 10] B: [-1, 1, 3, 5, 7, 9] C: [0, 2, 4, 6, 8]
- 如下代码运行后的输出结果是()。 ls = list(range(6)) ls.append(8) print(ls) A: [1, 2, 3, 4, 5, 6, 8] B: [0, 1, 2, 3, 4, 5, 8] C: [8, 1, 2, 3, 4, 5, 6] D: [8, 0, 1, 2, 3, 4, 5]
- 若有a = [2*x for x in range(4)],语句print(a)输出为 A: [2, 4, 8,16] B: [2, 4, 6, 8] C: [1, 2, 4, 8] D: [0, 2, 4, 6]