Hello, everyone, in this particular session, we will discuss about Boolean values, so the Biton
time for storing true and false values is called booie.
There are two types of boolean values, which is true and false.
So if I write true for the capital T, this means true viol.
If I write false with capital, if this means false.
Now, in case I write this without capitalization.
This will make no sense, this will be something different.
So make sure whenever you're using Boolean values to capitalize D and if for true and false, otherwise
they would lose their meaning.
Now, what we want to know for sure is that.
What is a boolean expression now, a boolean expression is an expression that evaluates a boolean value
and the user equality's operator, which would come back to values and produce boolean value related
to whether those two values are equal or not.
So let us see how we can do it.
So let's say we have two numbers.
Two and seven now I can compare these two numbers so I can use this stubley for the design, which means
equivalent to compare if two is equivalent to seven.
Now, if I evaluate this by running shift into that as it comes out to be false, because two is not
equal to seven now in case I see something like two is less than seven.
Now, this condition is true, so when I will run this, I will get through as a result when I do another
type of comparison where two is greater than seven.
When I evaluated this condition, I get a voice now, a one way of getting through and false values
is by using these companies and nobody does.
So there are different types of comparison operators such as.
Less than.
Greater than.
Less than equal to.
Greater than equal to.
Equivalent to then we have not equal to.
So these are different companies and operators, so I can use these operators to compare to values.
Now, let's see, we have a particular number, say seven, and we want to find out the boolean value
for it.
Now, one thing to know is that any value, which is not a null.
And also, it is not zero would be considered as true.
So in case I go and check the type of.
By converting it into a movie, it is converted into a movie.
So when I find out the bullying type, the bullying counterpart of Zettl.
I get points similarly, if I find out the bullying counterpart for non.
Because none is the language we use in fighting, so it is again for us now, apart from these two values,
if I use any other value, it could be eight.
It could be eight.
Hundred thousand, any higher value, it could be any negative value, all of these values would be
considered as true.
Now, another thing which we can do the use of for this is now there is a typical use that we have for
these boolean values, which is in comparison operators.
So you can use these comparisons to find out the truth value of this.
So what we can do is let us see.
We have a particular condition.
Same.
We have a name, which is.
Munsie And this is a string.
And we have another name, too, which is.
Also, Munsie, but without capital.
Now, if I try to compare this.
So we will say name equivalent to.
Name do.
So this gives us pause because these values are not the same.
Now let us try another thing.
Let us convert this into a lower and lower case.
So I I'm converting this into a.
Now I'm converting this into a lowercase so you can see we got a tool if we do not convert this into
a lowercase and convert this into capitalized.
We get to.
So we can use any kind of operator here, we can remove this, we could have given something like nameless
and equal to name to.
It is giving, shall we give?
Another condition he'll.
So we get calls so we can evaluate different of different logics here.
Now we can do something like.
Two is less than seven and seven is less than 90.
Now, if I'm writing this kind of condition, this is called a chained comparison.
So if I try to evaluate this, this comes out to be true.
Now, what this actually means is I'm trying to do something like two is less than seven and seven is
less than 90.
So here we are using this and operator.
And what this and operator does is it evaluates the first condition.
Then it evaluates the second condition.
And when we use designed operator, this means that.
If this particular condition is true and this particular condition is also true and we are doing in
and of both of these, then the result would we do so?
Let us run this again.
So we are getting a true here.
Now, let us say we meet this particular condition false because two is not greater than seven.
So the result of this one would be a false.
And this is still true, so if we valued this, we get a voice now on the operator, we can use an ampersand
and or we can simply write and it would mean just the same thing.
Now, another option is we can use in our operator and all, but our operator will check both of these
conditions.
And if any one of these conditions is true, it will return to.
Similarly, I can use this type of reader for also.
So it gives a false.
Here, all the do is greater than seven, which is a false statement, and seven greater than nine seven
less than 90 is a true statement.
With this pipe operator, which is used to or it should give desire, that's true, but it is giving
false it as a result because it is creating ambiguity between the list and the then signs present between
seven and seven.
So what we can do here is to make this more clear.
We can use these Brace's.
So once we use these braces and then evaluate, it gives us the results.
Drew.
Or apart from this, we can also do something like this.
Then we can create a chain operator and this chain operator will for the.
Give the result as false, because to greater than seven is a false statement.
So this gives a false while evaluating the complete thing.
But if we want, we can use the other way around, which is with the brackets.
So it works perfectly fine.
So now you can see how we can use different companies and operators to compare different values.
Thank you.