#三元运算,三目运算,if else简写 if 1 == 1: name = "liangml" else: name = "NB" #如果 1==1 成立,name = ”liangml“ 否则 name = "NB" name = "liangml" if 1 == 1 else "NB"#三元运算 #lambda表达式 def f1(a1): return a1 + 100 f2 = lambda a1: a1 + 100#默认已经有return ret = f1(10) print(ret) r2 = f2(9) print(r2)
本文出自 “Mr.Liang” 博客,请务必保留此出处http://liangml.blog.51cto.com/10852271/1855866
原文地址:http://liangml.blog.51cto.com/10852271/1855866