MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / take_match_action

Function take_match_action

example_code/item_009.py:69–78  ·  view source on GitHub ↗
(light)

Source from the content-addressed store, hash-verified

67
68print("Example 3")
69def take_match_action(light):
70 match light:
71 case "red":
72 print("Stop")
73 case "yellow":
74 print("Slow down")
75 case "green":
76 print("Go!")
77 case _:
78 raise RuntimeError
79
80
81take_match_action("red")

Callers 1

item_009.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected