added dot product

This commit is contained in:
midhun varman
2020-10-19 15:01:19 +05:30
parent ab960534f9
commit e77af6cdef

View File

@@ -4,9 +4,7 @@ from .__init__ import *
def vectorDotFunc(minVal=-20, maxVal=20):
a = [random.randint(minVal, maxVal) for i in range(3)]
b = [random.randint(minVal, maxVal) for i in range(3)]
c = [a[0] * b[0],
a[1] * b[1] ,
a[2] * b[2] ]
c = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]
problem = str(a) + " . " + str(b) + " = "
solution = str(c)