Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bslatkin/effectivepython
/ normalize
Function
normalize
example_code/item_021.py:51–57 ·
view source on GitHub ↗
(numbers)
Source
from the content-addressed store, hash-verified
49
50
print(
"Example 1"
)
51
def
normalize(numbers):
52
total = sum(numbers)
53
result = []
54
for
value in numbers:
55
percent = 100 * value / total
56
result.append(percent)
57
return
result
58
59
60
print(
"Example 2"
)
Callers
1
item_021.py
File · 0.85
Calls
1
append
Method · 0.45
Tested by
no test coverage detected