Ich möchte mehrere Vergleiche für eine logische Bedingung in Python machen, aber ich bin mir nicht sicher über die richtige für die and
und or
. Ich habe 2 Aussagen.Mehrere logische Vergleiche in einer einzigen Zeile für eine if-Anweisung
Statement 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:
Statement 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
Ist oder-ing die beiden ands der richtige Weg, um darüber zu gehen?
Danke.
'PAB> BAC und PAB
mgilson
'PAB',' PAC' und 'BAC' sind Winkel von 3 Dreiecken mit gemeinsamen Ecken. 'PAB> BAC und PAB
@markmcmurray: Ich habe das als 'a Eric