MCPcopy 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
50print("Example 1")
51def 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
62print("Example 2")

Callers 1

item_009.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected