通过 dict 及其 get(key[, default]) 方法实现。
1 | def f(x): |
refs: https://stackoverflow.com/questions/60208/replacements-for-switch-statement-in-python
sh∅ut
通过 dict 及其 get(key[, default]) 方法实现。
1 | def f(x): |
refs: https://stackoverflow.com/questions/60208/replacements-for-switch-statement-in-python