How would I condense A > B or B > C /u/Alongsnake Python Education

I am looking to condense

if A > B or B > C: return False # Basically if Min > Value or Value > Max: return False 

I have seen this notation

if A > B > C: 

But I believe it means

if A > B and B > C: 

I suppose I may have to do

if not (A < B < C): 

Or is there a better way?

submitted by /u/Alongsnake
[link] [comments]

​r/learnpython I am looking to condense if A > B or B > C: return False # Basically if Min > Value or Value > Max: return False I have seen this notation if A > B > C: But I believe it means if A > B and B > C: I suppose I may have to do if not (A < B < C): Or is there a better way? submitted by /u/Alongsnake [link] [comments] 

I am looking to condense

if A > B or B > C: return False # Basically if Min > Value or Value > Max: return False 

I have seen this notation

if A > B > C: 

But I believe it means

if A > B and B > C: 

I suppose I may have to do

if not (A < B < C): 

Or is there a better way?

submitted by /u/Alongsnake
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *