Comparisons and Boolean logic

Values can be compared for equality using the operator ==:

The special symbols True and False are used to denote truth values. Naturally, there are inequality comparisons as well:

Inequalities can be chained:

Truth values can be negated using ! (logical not) and combined using && (logical and) and || (logical or):

&& has higher precedence than ||, i.e. it binds stronger: