已知 vec = [[1,2], [3,4]],则表达式 [[row[i] for row in vec] for i in range(len(vec[0]))]的值为______________()_________。[/i]
A: [1, 2, 3, 4]
B: [[1, 2, 3], 4]
C: [[1, 3], [2, 4]]
D: [1, 2, [3, 4]]
A: [1, 2, 3, 4]
B: [[1, 2, 3], 4]
C: [[1, 3], [2, 4]]
D: [1, 2, [3, 4]]
举一反三
- 已知 vec=[[1,2],[3,4]],则表达式[[row[i] for row in vec] for i in range(len(vec[0]))]的值为( )[/i]
- 已知列表m=[[1,2],[3,4]],有列表a=[[row[i] for row in m] for i in range(2)],则a[0][1]是[/i]
- 已知x=[[1,2,3],[4,5,6]],表达式[[row[i] for row in x] for i in range(len(x[0]))]的值为(______ )。[/i]
- 已知a=[[1,2,3],[2,2],[3,2,1]],则a[1][1]+a[-1][-1]结果是 A: 1 B: 2 C: 3 D: 4
- 已知f=lambda x,y:x+y,则f([4],[1,2,3])的值是( )。 A: [1, 2, 3, 4] B: 10 C: [4, 1, 2, 3] D: {1, 2, 3, 4}