Write a NumPy program to compute the inner product of two given vectors

  • برمجة بايثون

Write a NumPy program to compute the inner product of two given vectors

الأجوبة

import numpy as np
x = np.array([4, 5])
y = np.array([7, 10])
print("Original vectors:")
print(x)
print(y)
print("Inner product of said vectors:")
print(np.dot(x, y))

Sample Output:

Original vectors:
[4 5]
[ 7 10]
Inner product of said vectors:
78
هل كان المحتوى مفيد؟

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...