MCPcopy Index your code
hub / github.com/bslatkin/effectivepython / get_first_int

Function get_first_int

example_code/item_004.py:104–108  ·  view source on GitHub ↗
(values, key, default=0)

Source from the content-addressed store, hash-verified

102
103print("Example 7")
104def get_first_int(values, key, default=0):
105 found = values.get(key, [""])
106 if found[0]:
107 return int(found[0])
108 return default
109
110
111print("Example 8")

Callers 1

item_004.pyFile · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected