以下程序段输出为 [2,4,8,16,32] a = [2**x for x in range(5)] print(a)
举一反三
- 以下程序段输出为 [2,4,8,16,32] a = [2**x for x in range(5)] print(a) A: 正确 B: 错误
- 若有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]
- 以下程序的输出结果是: frame = [[1,2,3],[4,5,6],[7,8,9]] rgb = frame[::-1] print(rgb) A: [[7, 8, 9]] B: [[1,2,3],[4,5,6],[7,8,9]] C: [[7, 8, 9], [4, 5, 6], [1, 2, 3]] D: [[1, 2, 3], [4, 5, 6]]
- 以下程序的输出结果是:( )。frame = [[1,2,3],[4,5,6],[7,8,9]]rgb = frame[::-1]print(rgb) A: [[1,2,3],[4,5,6],[7,8,9]] B: [[1, 2, 3], [4, 5, 6]] C: [[7, 8, 9], [4, 5, 6], [1, 2, 3]] D: [[7, 8, 9]]
- 以下程序的输出结果是:<br/>frame<br/>= [[1,2,3],[4,5,6],[7,8,9]]; rgb<br/>= frame[::-1]; print(rgb) A: [[7, 8, 9], [4, 5, 6], [1, 2, 3]] B: [[1, 2, 3], [4, 5, 6]] C: [[7, 8, 9]] D: [[1,2,3],[4,5,6],[7,8,9]]