a = None b = 'Test' if a is None or b is None: print('Test')
这个版本显然有效但是:
if (a or b) is None: print('Test')
预期会得到相同的结果,但评估为False,为什么?
python syntax
python ×1
syntax ×1