Booleans, Expressions, & If Statements
Boolean
A boolean is a data type true or false value.
Here are some things you can remember about a boolean.
Logical Expressions
A logical expression is some expression that can/will be simplified into a single “true” or “false” value.
This is typically done by using comparison operators, for example...
This would print out 1 (remember, true = 1).
Logical Operators
Here is a list of important logical operators we use often:
Here is a list of comparison operators:
If Statements
An if statement is a statement that runs code only if the given expression evaluates to true, an example of this can be the following.
This is typically done by using comparison operators, for example...
This if statement will run all the code inside of the brackets if x > y evaluates to true.