摘要:
Python & dict & switch...case All In One
💩 Python 中是没用switch语句的,这应该是体现 Python 大道至简的思想,Python 中一般多用字典来代替 Switch 来实现。
在 Python 中没有 switch...case 语句,但在 Python3.10 版本添加了 match...case,功能也类似,详见下文。
Python 3.10 增加了 match...case 的条件判断,不需要再使用一连串的 if-else 来判断了。
match 后的对象会依次与 case 后的内容进行匹配,如果匹配成功,则执行匹配到的表达式,否则直接跳过,_ 可以匹配一切。
阅读全文
摘要:
Spyder & Python All In One
阅读全文
摘要:
How to install python3 on macOS All In One
阅读全文
摘要:
NLP & AI
极简验证码 阅读全文