Program to multiply two vectors using NumPy.

In this python numpy program, we will multiply two vectors using NumPy.

Steps to solve the program
  1. Import the numpy library as np.
  2. Create two arrays using np.array().
  3. Multiply two arrays using .
  4. Print the output.
				
					import numpy as np
x = np.array([4,2,8])
y = np.array([7,3,5])

print(x*y)
				
			

Output :

				
					[28  6 40]
				
			

create a vector with values from 1 to 15 and change the sign of the numbers in the range from 6 to 10.

create a 2×3 matrix filled with values from 5-10.

Leave a Comment