当前位置: 移动技术网 > IT编程>脚本编程>Python > python 带default的switch

python 带default的switch

2019年04月05日  | 移动技术网IT编程  | 我要评论

蜜桃成熟时3高清,闻立瘦芳香瘦身卡,exun

带默认处理的python switch

[python] 
def foo(): 
    print "foo" 
 
def default(): 
    print "defalut" 

    "foo" : lambda : foo() 
}.get(value,default)() 


 

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网