4. Branches
A branch is a way of having the computer make a choice, depending upon a variable's value. This is sometimes called a "conditional", because it depends upon a certain condition.
For an example, try the following trinket. Click "Run" first, just to try the program. Then follow the instructions within the program to make some changes.
For an example, try the following trinket. Click "Run" first, just to try the program. Then follow the instructions within the program to make some changes.
With text strings, you can use == to test if two strings are the same, and != to test if two strings are different. With numbers, you can also use other "operators" to test for greater than or less than. You can also use "or" and "and" to combine two or more operators. Here's another trinket: