...

/

Exercise: Accessing 2-Dimensional Arrays

Exercise: Accessing 2-Dimensional Arrays

Let's slice a 2-dimensional array in this exercise.

Task #

In this exercise, we will use different techniques to extract useful information from a 2-dimensional array.

Problem statement #

For the array arr given in the code below, write code to print:

  • the first row of arr
  • the first column of arr
  • the third row of arr
  • the last two columns of arr
  • the 2 by 2 block of values in the upper right-hand corner of arr
  • the 2 by 2 block of values at the center of arr
Access this course and 1400+ top-rated courses and projects.