#### Exercise 557

Consider the following matrix: A = np.array ([[3, -1], [-1, 4], [7,11]]) Give the Python code numpy which displays the rows of the matrix as follows:

*line number 1 is: [3 -1] *

*line number 2 is: [-1 4] *

*line number 3 is: [7 11] *

#### Solution

`import numpy as np`

A = np.array([[3, -1],

[-1 , 4],

[7,11]])

B = np.append(A , [[1 , 1]])

i = 1

for x in A:

print("ligne number ", i , " is : " , x)

i = i + 1

**Younes Derfoufi**

my-courses.net

my-courses.net