What's the result of the following statement: (1, 2) in zip(range(4), range(2,6))
举一反三
- 下列程序的执行结果是( ).for i in range(2): print(i,end=' ' )for I in range(4,6): print(I,end=' ' ) A: 2 4 6 B: 0 1 2 4 5 6 C: 0 1 0 1 2 3 D: 0 1 4 5
- 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]
- 若有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]
- 下面代码的输出结果为( ) for i in range(1, 7): if i % 2 == 0: print(i, end=" ") A: 1 2 3 4 5 6 7 B: 1 2 3 4 5 6 C: 2 4 6 7 D: 2 4 6
- “[ 2*x+2 for x in range(5) ]”生成的列表是( )。 A: [2, 4, 6, 8, 10] B: [0, 2, 4, 6, 8] C: [1, 2, 3, 4, 5] D: [0, 1, 2, 3, 4]