📜  在 python 中切换' - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:21.807000             🧑  作者: Mango

代码示例1
def week(i):
    switcher={
        0:'Sunday',
        1:'Monday',
        2:'Tuesday',
        3:'Wednesday',
        4:'Thursday',
        5:'Friday',
        6:'Saturday'
    }
    return switcher.get(i,"Invalid day of week")

print(week(5)) # Call the function