关于return python

python里面 return 和if else怎么写在一行 求指点


def f():
    x = 1
    return 2 if x == 1 else 3

print(f())