我想对 python 中的逻辑条件进行多重比较,但我不确定and
and的正确方法or
。我有 2 个陈述。
声明 1:
#if PAB is more than BAC and either PAB is less than PAC or PAC is more than BAC
if PAB > BAC and PAB< PAC or PAB > BAC and PAC>BAC:
声明 2:
#if PAB is more than BAC and PAC is less than PAB or if PAB is less than BAC and PAC is less than BAC
if PAB >BAC and PAC<PAB or PAB<BAC and PAC<BAC
or-ing这两个ands是正确的方法吗?
谢谢。