Hello and welcome guys.
And in this lecture we're gonna learn about operators so we've already briefly done a few operators
while actually doing this course already.
But now we're gonna go a bit more in depth so the first operator I want to show you is this one.
So if we go into X equals one above two.
Now while this says is one above TWO.
THAT'S WHAT THIS RIGHT ARROW IS fall and it returns true if it is and false if it isn't.
So again you can use this in a statement as well which might be clearer if I do that actually.
And what we can do we'll just do is X above to just say is clearer for you.
So in this scenario it says is X above 2 if it is run whatsoever in here.
Now let me show you the above equal operator.
So as a right our an equals sign that means a if X is equal to two or above to then run the code in
here and in here.
Right.
And then the left arrow means is X below 2 if it is run the code in here and the Left Arrow equals means
is X below equal to if it is run the code in here.
So there is some of the comparison operators and you already know that equals equals.
If X is equal to to run the code in here now the does not equal is the explanation Mark and the equals.
So if X is not equal to to run the code in here.
So that fast so that they are the operators for comparison.
And you can also do things like this.
So what does this mean.
If X does not equal to all x equals three then run the code in here.
That's what that means.
This is the all this is that these two lines mean.
All right.
Now let's try this and show y equals 1.
So if X is true and Y is true then the code in here if x equals zero.
And why does not equal one run the code in here if x equals zero and Y equals 1.
Run the code in here so you can use to ampersand is to basically combine logic and you can use two of
these lines to combine logic.
So both of those operators allow you to combine logic when doing comparisons
so let's talk about these other operators that I'm sure you're aware of if you have used a calculator
before Y equals X divided by two.
So this forward slash means divide Y equals X asterisk to that means Y equals X multiplied by two Y
equals X plus three.
This means Y equals X plus three.
So essentially add three two X Y equals X minus three.
So minus three from x x y y will equal Y equals X percent three get the remainder.
So the percent is four remainder.
So.
So it divides and gives you the remainder.
That is what the percent is for.