4 lines
113 B
Python
4 lines
113 B
Python
def scalar_product(x, y, dimension):
|
|
sum = 0.0
|
|
for i in range(dimension): sum += x[i]*y[i]
|
|
return sum |