传统的写法 condition = True if condiction: x = 1 else: x = 2 print(x) pythonic 写法 x = 1 if condition else 2