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

Function normalize_func

example_code/item_021.py:110–116  ·  view source on GitHub ↗
(get_iter)

Source from the content-addressed store, hash-verified

108
109print("Example 8")
110def normalize_func(get_iter):
111 total = sum(get_iter()) # New iterator
112 result = []
113 for value in get_iter(): # New iterator
114 percent = 100 * value / total
115 result.append(percent)
116 return result
117
118
119print("Example 9")

Callers 1

item_021.pyFile · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected