d = 7 sw={ 0:‘sun‘, 1:‘tue‘, 2:‘wed‘ } name =sw.get(d,‘unkown‘) print(name)
python技巧 用字典代替switch
原文:https://www.cnblogs.com/angdh/p/11723862.html