Task-
In the given array or matrix, we have to multiple a number in each elements of the array.
Example-
array is [1 2 3 4]
then array*2 will give [2 4 6 8]
program-
#import numpy
import numpy as np
l=[1,2,3,4,5]
arr=np.array(l)
print("Matrix is :",arr)
print("After Multiple 2 :",arr*2)
l=[[1,2,3],[4,5,1],[1,1,0]]
arr=np.array(l)
print("nMatrix is :n",arr)
print("After Multiple 3 :n",arr*3)
Matrix is : [1 2 3 4 5]
After Multiple 2 : [ 2 4 6 8 10]
Matrix is :
[[1 2 3]
[4 5 1]
[1 1 0]]
After Multiple 3 :
[[ 3 6 9]
[12 15 3]
[ 3 3 0]]