三元运算又叫三目运算。
result = "A" if x > y else "B" #如果条件成立,result=A,否则,result=B。
对于简单的函数,可用lambda表达式。
def f1(a1): return a1 + 100
f1 = lambda a1: a1 + 100