match-case

Python的match-case语法

Python 3.10版本在2021年10月发布,新增了match-case语法。其实就是对应别的开发语言的switch-case语法。 例子 def http_error(status): match status: case 400: print("Bad request") case 404: ......
语法 match-case Python match case
共1篇  :1/1页 首页上一页1下一页尾页