首页 > 试题广场 >

在Python 3.10中,以下match语句的输出是什么?

[单选题]
在Python 3.10中,以下match语句的输出是什么?
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

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