我试了下 python 类似的操作: print('python is shit!' if 0.1 + 0.2 != 0.3 else 'python is awesome!') print('python is shit!' if True+True+True == 3 else 'python is awesome!') print('python is shit!' if True-True == 0 else 'python is awesome!') print('python is shit!' if True == 1 and not(True is 1) else 'python is awesome!')