我想对python中的逻辑条件进行多次比较,但我不确定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
正确地选择这两个人是正确的方法吗?
感谢。