Desidero eseguire confronti multipli per una condizione logica in python ma non sono sicuro della direzione corretta per and
e or
. Ho 2 dichiarazioni.Confronti logici multipli su una singola riga per un'istruzione if
Dichiarazione 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:
Dichiarazione 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
è o-zione dei due ands il modo corretto di andare su di esso?
Grazie.
'PAB> BAC e PAB
mgilson
'PAB',' PAC' e 'BAC' sono angoli di 3 triangoli con vertici comuni. 'PAB> BAC e PAB
@markmcmurray: ho interpretato erroneamente come "a Eric