Sample code for ternary operation + lambda expression
This article mainly introduces the ternary operation +lambda expression example code, the article is very detailed, has a certain reference value, interested friends must read!
#ternary operation, ternary operation,if else abbreviation if 1 == 1: name = "liangml"else: name = "NB"#if 1==1 holds, name = "liangml" otherwise name = "NB"name = "liangml" if 1 == 1 else "NB"#ternary operation #lambda expression def f1(a1): return a1 + 100f2 = lambda a1: a1 + 100#default already has return ret = f1(10)print(ret)r2 = f2(9)print(r2) above is "ternary operation +lambda expression example code" All the contents of this article, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!