What are operators in programming
Symbols that do something with values, like plus, minus, greater than, and equal to, are called operators. Some make a new value, and some compare two values and give true or false. The true or false that conditions used in the last lesson comes from right here.
Add, subtract, multiply
The most familiar operators are for calculating.
Put in two values with plus, minus, times, or divided by, and one new value comes out.
Change the symbol below and you'll see right away how the result changes.
Two values plus one symbol make a new value. It starts at 7 + 4 = 11.
Two numbers and one symbol are all you need.
Depending on the symbol, the numbers get added or subtracted.
Operators that make a new value from values like this are arithmetic operators, just like on a calculator.
Greater, less, equal
Another kind of operator compares two values.
Compare two values with "greater than, less than, equal to," and what comes out isn't a number but true or false.
"7 is greater than 4" is true, and "7 is equal to 4" is false.
Compare two values and you get true or false. It starts at 7 > 4 → true.
Calculating operators make new values, and comparing operators give true or false.
The "if" in the last lesson chose its path with exactly this true or false.
What does this symbol do?
Let's meet the operator symbols one by one.
What each one does is summed up in a line: adding, subtracting, comparing.
Tap a symbol and its meaning appears.
Tap a symbol to see what it means. Yellow symbols calculate (new value); blue symbols compare (true or false).
There aren't many symbols.
Yet with just these few, you can add and build decisions.
Each is simple, but together they can do almost anything: small tools.
True or false leads to the fork
Why do comparing operators matter?
Because the true or false they give is the switch for the "if" fork we saw in the last lesson.
Compare "Is the score 60 or more?": if true, take the pass path; if false, the fail path.
Compare → true or false → if (fork). 75 ≥ 60 → true → pass.
That's how Lessons 6 and 5 connect.
Operators make true or false, and "if" takes it and chooses a path.
One small symbol grows into a program's decision.
Hands that make and compare values
Operators are the hands that handle values.
They add to make new values and compare to give true or false.
With these hands, a program calculates and decides.
In the next lesson, we'll see how to have the same thing done many times.
Now that you know the symbols, what's next. Operator = a symbol that makes and compares values → loops · functions · beyond.
We've now come as far as naming values (variables), knowing their types (data types), comparing to decide (conditions), and calculating (operators).
With these tools, built up one at a time, we'll go on to make bigger and bigger things.