We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a72df73 commit 0f700d1Copy full SHA for 0f700d1
1 file changed
math_library.py
@@ -0,0 +1,4 @@
1
+def scalar_product(vector1, vector2):
2
+ if len(vector1) != len(vector2):
3
+ raise ValueError("Vectors must be of the same length")
4
+ return sum(x * y for x, y in zip(vector1, vector2))
0 commit comments