Here is a multidimensional array,a=[[1,2,3,4],[5,6,7,8],[9,10,11,12]]
Now I want to get the elements in the array from the first row to the second row and from the first column to the third column to form a new multidimensional array,the result should be b=[[1,2,3],[5,6,7]]. What should I do?I would appreciate it if you could help me with this problem
One solution:
b=[a[0][0..2],a[1][0..2]]
You can find more about array operations for example here: