diff options
Diffstat (limited to 'accessing-pieces-arrays/script.rst')
-rw-r--r-- | accessing-pieces-arrays/script.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/accessing-pieces-arrays/script.rst b/accessing-pieces-arrays/script.rst index 9599835..b6567a4 100644 --- a/accessing-pieces-arrays/script.rst +++ b/accessing-pieces-arrays/script.rst @@ -62,6 +62,8 @@ use to work through this tutorial. Pause the video here and make sure you have the arrays A and C, typed in correctly. +{{{ Pause the recording and type the arrays A,C }}} + Let us begin with the most elementary thing, accessing individual elements. Also, let us first do it with the one-dimensional array A, and then do the same thing with the two-dimensional array. @@ -72,6 +74,8 @@ To access, the element 34 in A, we say, A[2] +A of 2, note that we are using square brackets. + Like lists, indexing starts from 0 in arrays, too. So, 34, the third element has the index 2. @@ -80,6 +84,8 @@ Now, let us access the element 34 from C. To do this, we say C[2, 3] +C of 2,3. + 34 is in the third row and the fourth column, and since indexing begins from zero, the row index is 2 and column index is 3. |