Python的switch替换方案、列表推导式、字典推导式 BG7ZAG | 2020-2-19 23:37 | 511 | 0 | 程序开发 77 字 | 4 分钟 switch替换方案 day = 8 def get_sunday(): return 'Sunday' def get_monday(): return 'Monday' def get_tuesday(): return 'Tuesday' def get_default(): return 'Unkown' switcher = { 0: g… Pythonswitch列表推导式字典推导式