1.话不多说上代码,Python一切皆对象的又一体现
#coding:utf-8
'''字典代替switch'''
# 字典代替switchday=4
# some_day={
# 0:'sunday',
# 1:'monday',
# 2:'tuesday'
# }
# one_day=some_day.get(day,'unknow')
# print(one_day)
'''字典对应得可以为函数'''
day=0
def get_sun(
1.话不多说上代码,Python一切皆对象的又一体现
#coding:utf-8
'''字典代替switch'''
# 字典代替switchday=4
# some_day={
# 0:'sunday',
# 1:'monday',
# 2:'tuesday'
# }
# one_day=some_day.get(day,'unknow')
# print(one_day)
'''字典对应得可以为函数'''
day=0
def get_sun(