INF205/lab_1/2.py

4 lines
113 B
Python
Raw Normal View History

2024-02-24 10:37:06 +00:00
def scalar_product(x, y, dimension):
sum = 0.0
for i in range(dimension): sum += x[i]*y[i]
return sum