L[0]代表是数组的第一个数组,那为什么cube[0],就代表数组的第一个数呢?
L = [[1,2,3], [5, 3, 2], [7,3,2]] for cube in L: length = cube[0] width = cube[1] height = cube[2] result = length * width * 2 + width * height * 2 + length * height * 2 print(result
L = [[1,2,3], [5, 3, 2], [7,3,2]] for cube in L: length = cube[0] width = cube[1] height = cube[2] result = length * width * 2 + width * height * 2 + length * height * 2 print(result
2022-10-25
举报