Q:

Write a NumPy program to multiply the values ​​of two given vectors

0

Write a NumPy program to multiply the values ​​of two given vectors

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import numpy as np
x = np.array([1, 8, 3, 5])
print("Vector-1")
print(x)
y= np.random.randint(0, 11, 4)
print("Vector-2")
print(y)
result = x * y
print("Multiply the values of two said vectors:")
print(result)

Sample Output:

Vector-1
[1 8 3 5]
Vector-2
[1 6 4 6]
Multiply the values of two said vectors:
[ 1 48 12 30]

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now