Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bslatkin/effectivepython
/ careful_divide
Function
careful_divide
example_code/item_032.py:51–55 ·
view source on GitHub ↗
(a, b)
Source
from the content-addressed store, hash-verified
49
50
print(
"Example 1"
)
51
def
careful_divide(a, b):
52
try
:
53
return
a / b
54
except
ZeroDivisionError:
55
return
None
56
57
58
assert careful_divide(4, 2) == 2
Callers
1
item_032.py
File · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected