Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bslatkin/effectivepython
/ take_action
Function
take_action
example_code/item_009.py:51–59 ·
view source on GitHub ↗
(light)
Source
from the content-addressed store, hash-verified
49
50
print(
"Example 1"
)
51
def
take_action(light):
52
if
light ==
"red"
:
53
print(
"Stop"
)
54
elif
light ==
"yellow"
:
55
print(
"Slow down"
)
56
elif
light ==
"green"
:
57
print(
"Go!"
)
58
else
:
59
raise
RuntimeError
60
61
62
print(
"Example 2"
)
Callers
1
item_009.py
File · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected