MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / dot_product

Function dot_product

example_code/item_095.py:51–55  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

49
50print("Example 1")
51def dot_product(a, b):
52 result = 0
53 for i, j in zip(a, b):
54 result += i * j
55 return result
56
57print(dot_product([1, 2], [3, 4]))
58

Callers 1

item_095.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected