Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
50
print(
"Example 1"
)
51
def
dot_product(a, b):
52
result = 0
53
for
i, j in zip(a, b):
54
result += i * j
55
return
result
56
57
print(dot_product([1, 2], [3, 4]))
58
Callers
1
item_095.py
File · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected