Python最近在python 3.10版本中发布了match case。问题是我们如何在python中为case做一个默认值。我可以做if elif但不知道怎么做。下面是代码。
x = "hello"
match x:
case "hi":
print(x)
case "hey":
print(x)
default:
print("not matched")
我自己添加了这个默认值。我想知道在 python 中执行此操作的方法