command = {"action": "move", "direction": "north", "speed": 5}
match command:
case {"action": "move", "direction": direction, **rest}:
print(f"{direction}, {rest}")
case {"action": "move"}:
print("move only") command = {"action": "move", "direction": "north", "speed": 5}
match command:
case {"action": "move", "direction": direction, **rest}:
print(f"{direction}, {rest}")
case {"action": "move"}:
print("move only") north, {'speed': 5}move only
north, {}抛出SyntaxError

这道题你会答吗?花几分钟告诉大家答案吧!