In computing, we work with lots of different forms of data. But the real fun comes when we can do something with this data.
In this lesson, we’ll look at how we can write short computer programs using operators.
Operators are different symbols that represent an operation, such as the plus sign (
+) as a symbol for addition. Operations enable us to process our data, to transform it into something else.
You may already be familiar with operators and operations from other contexts. This lesson looks at different ways we can use operators in programming, including:
- Making calculations using arithmetic operators.
- Comparing information using comparison operators.
- Creating logical expressions using logical (aka Boolean) operators.
We can think of writing a program as similar to following a recipe.
In this lesson, we’ll look at how we can use operators to make a fruit salad.
To make the salad, we’ll use operators to:
- Calculate the fruit needed
- Compare the different fruits
- Determine if we have the right ingredients
Right now, we can only add or take away data points by manually including them or deleting them from our code, sort of like adding and subtracting.
When you’re ready, move to the next exercise.