Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bslatkin/effectivepython
/ flip_coin
Function
flip_coin
example_code/item_023.py:53–57 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
51
import
random
52
53
def
flip_coin():
54
if
random.randint(0, 1) == 0:
55
return
"Heads"
56
else
:
57
return
"Tails"
58
59
def
flip_is_heads():
60
return
flip_coin() ==
"Heads"
Callers
2
flip_is_heads
Function · 0.85
flip_is_tails
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected