So now, since we finished most of the difficult operations or most of the different operations compared
with the simple math.
Let's move on to comparisons now.
First of all, we need to think on what is the result of doing a comparison where usually the result
is true or false.
And I will prove this.
So if X is equal to five.
Higher than for.
This statement is true because five is higher than for the less right to print.
X. So now if I print X, I will get through because X here is assigned to a variable, X can be either
true or false because five is either higher than four or it's not fair to them for their just options,
then you can also do a different comparison by writing five, not equal to four.
And this means not so five is five, not equal to four.
Yes, it is.
For that reason our answer is true.
For example, if I do so, this is the comparison operator for equal.
It is different than a single equal sign, as you can see.
And yes, we can actually write the statement like that here.
So here we're checking that if five is equal to four.
So as you know, this is obviously not equal.
And for that reason we're going to get false here because force is assigned to the variable effects.
Now in Python, as in the other programming languages there, logical operations, OK?
And as in C++ and in Java, usually the large corporations are performed by symbols.
For example, this symbol is the symbol for and and usually or is denoted like this.
But in Python, we don't have that.
We don't recognize the symbols instead for simplicity and just our code to make sense.
Plus we simply use the word or for our statement and we use the word and for any statement.
And I will show you how this works, so let's write that, for example, our rent is equal to five hundred
and fifty dollars.
OK, then what would like to do is we want to print rent higher than 50 or rent more than 100.
So let's think a little bit about it.
Is our rent higher than 50 dollars?
We said this is our rents, more than 100 hundred dollars.
No, it is not.
But since here we have the our statement.
This means only one of the statements needs to be true for the whole line to be true, because this
is.
All right.
So if I run the code now.
You can see that the final result here is true because one of the statements here is true.
OK, let's change this word to end.
So when you're right and this means that both of the statements have to be true, right, so both the
rent should be higher than 50 and bolder and more than 100.
But since our rent is not in the range between 50 and 100, then the statement should be false.
So let's run the code and you can see that our result here is false.
For example, if I do that, I would like my rent to be more than one thousand.
OK, since it is five hundred and fifty.
Then we get the results because both of the statements in the and large corporation are equally true,
then the whole line is true.
You can add as many conditions as you want.
So I can even after one more condition, rent should not be equal to 400.
And this, again, will be true because our rent is not equal to 400.
So you can see that now in the results we are getting because of our end statements are true and we
can continue like this until we finish with our ideas for what those corporations to at.