Comparisons and Boolean logic
Values can be compared for equality using the == operator:
>> 3 == 3True
>> 3 == 4FalseThe special symbols True and False are used to denote truth values. Naturally, there are inequality comparisons as well:
>> 3 > 4FalseTruth values can be negated using ! (logical not) and combined using && (logical and) and || (logical or):
>> !TrueFalse
>> !FalseTrue
>> 3 < 4 && 6 > 5True&& has higher precedence than ||, i.e. it binds stronger:
>> True && True || False && FalseTrue
>> True && (True || False) && FalseFalse