WEBVTT

00:01.020 --> 00:07.920
Hello, everyone, in this particular session, we will discuss about Boolean values, so the Biton

00:07.920 --> 00:12.310
time for storing true and false values is called booie.

00:12.840 --> 00:17.790
There are two types of boolean values, which is true and false.

00:18.270 --> 00:26.540
So if I write true for the capital T, this means true viol.

00:27.240 --> 00:31.530
If I write false with capital, if this means false.

00:31.920 --> 00:36.270
Now, in case I write this without capitalization.

00:38.510 --> 00:41.200
This will make no sense, this will be something different.

00:42.300 --> 00:51.570
So make sure whenever you're using Boolean values to capitalize D and if for true and false, otherwise

00:51.570 --> 00:52.860
they would lose their meaning.

00:54.770 --> 00:59.030
Now, what we want to know for sure is that.

01:00.730 --> 01:09.400
What is a boolean expression now, a boolean expression is an expression that evaluates a boolean value

01:10.360 --> 01:18.040
and the user equality's operator, which would come back to values and produce boolean value related

01:18.040 --> 01:21.730
to whether those two values are equal or not.

01:22.150 --> 01:23.990
So let us see how we can do it.

01:24.370 --> 01:26.980
So let's say we have two numbers.

01:28.420 --> 01:38.290
Two and seven now I can compare these two numbers so I can use this stubley for the design, which means

01:38.290 --> 01:42.910
equivalent to compare if two is equivalent to seven.

01:43.270 --> 01:51.580
Now, if I evaluate this by running shift into that as it comes out to be false, because two is not

01:51.580 --> 01:56.860
equal to seven now in case I see something like two is less than seven.

01:57.930 --> 02:05.880
Now, this condition is true, so when I will run this, I will get through as a result when I do another

02:05.880 --> 02:09.780
type of comparison where two is greater than seven.

02:10.910 --> 02:21.110
When I evaluated this condition, I get a voice now, a one way of getting through and false values

02:21.110 --> 02:23.920
is by using these companies and nobody does.

02:24.200 --> 02:29.540
So there are different types of comparison operators such as.

02:30.990 --> 02:31.740
Less than.

02:33.810 --> 02:34.590
Greater than.

02:36.060 --> 02:37.380
Less than equal to.

02:38.680 --> 02:39.940
Greater than equal to.

02:41.190 --> 02:47.880
Equivalent to then we have not equal to.

02:49.330 --> 02:55.810
So these are different companies and operators, so I can use these operators to compare to values.

02:57.590 --> 03:04.580
Now, let's see, we have a particular number, say seven, and we want to find out the boolean value

03:04.580 --> 03:04.970
for it.

03:05.630 --> 03:13.070
Now, one thing to know is that any value, which is not a null.

03:14.010 --> 03:19.870
And also, it is not zero would be considered as true.

03:20.340 --> 03:25.430
So in case I go and check the type of.

03:27.720 --> 03:32.900
By converting it into a movie, it is converted into a movie.

03:33.660 --> 03:38.490
So when I find out the bullying type, the bullying counterpart of Zettl.

03:40.480 --> 03:46.360
I get points similarly, if I find out the bullying counterpart for non.

03:47.390 --> 03:57.040
Because none is the language we use in fighting, so it is again for us now, apart from these two values,

03:57.230 --> 04:01.060
if I use any other value, it could be eight.

04:02.320 --> 04:03.560
It could be eight.

04:04.690 --> 04:13.480
Hundred thousand, any higher value, it could be any negative value, all of these values would be

04:13.480 --> 04:14.750
considered as true.

04:17.890 --> 04:28.450
Now, another thing which we can do the use of for this is now there is a typical use that we have for

04:28.450 --> 04:32.460
these boolean values, which is in comparison operators.

04:32.890 --> 04:40.840
So you can use these comparisons to find out the truth value of this.

04:41.140 --> 04:43.930
So what we can do is let us see.

04:43.960 --> 04:45.960
We have a particular condition.

04:46.300 --> 04:47.050
Same.

04:48.010 --> 04:51.130
We have a name, which is.

04:52.250 --> 04:55.880
Munsie And this is a string.

04:58.220 --> 05:04.520
And we have another name, too, which is.

05:05.710 --> 05:09.190
Also, Munsie, but without capital.

05:09.640 --> 05:12.160
Now, if I try to compare this.

05:14.190 --> 05:18.060
So we will say name equivalent to.

05:22.380 --> 05:23.610
Name do.

05:25.120 --> 05:30.620
So this gives us pause because these values are not the same.

05:31.450 --> 05:33.700
Now let us try another thing.

05:33.710 --> 05:38.220
Let us convert this into a lower and lower case.

05:38.590 --> 05:40.660
So I I'm converting this into a.

05:48.860 --> 05:56.780
Now I'm converting this into a lowercase so you can see we got a tool if we do not convert this into

05:56.780 --> 06:00.650
a lowercase and convert this into capitalized.

06:10.030 --> 06:10.810
We get to.

06:12.720 --> 06:20.880
So we can use any kind of operator here, we can remove this, we could have given something like nameless

06:20.880 --> 06:22.380
and equal to name to.

06:24.690 --> 06:28.440
It is giving, shall we give?

06:32.370 --> 06:33.930
Another condition he'll.

06:35.180 --> 06:40.330
So we get calls so we can evaluate different of different logics here.

06:40.670 --> 06:43.100
Now we can do something like.

06:44.170 --> 06:50.510
Two is less than seven and seven is less than 90.

06:51.070 --> 06:56.640
Now, if I'm writing this kind of condition, this is called a chained comparison.

06:57.160 --> 07:00.850
So if I try to evaluate this, this comes out to be true.

07:01.030 --> 07:10.360
Now, what this actually means is I'm trying to do something like two is less than seven and seven is

07:10.600 --> 07:11.830
less than 90.

07:12.220 --> 07:15.090
So here we are using this and operator.

07:15.430 --> 07:20.590
And what this and operator does is it evaluates the first condition.

07:21.700 --> 07:24.240
Then it evaluates the second condition.

07:24.880 --> 07:28.420
And when we use designed operator, this means that.

07:29.590 --> 07:35.710
If this particular condition is true and this particular condition is also true and we are doing in

07:35.890 --> 07:40.030
and of both of these, then the result would we do so?

07:40.450 --> 07:42.120
Let us run this again.

07:42.460 --> 07:44.140
So we are getting a true here.

07:44.530 --> 07:50.800
Now, let us say we meet this particular condition false because two is not greater than seven.

07:51.070 --> 07:53.830
So the result of this one would be a false.

07:55.060 --> 08:04.120
And this is still true, so if we valued this, we get a voice now on the operator, we can use an ampersand

08:04.120 --> 08:09.430
and or we can simply write and it would mean just the same thing.

08:09.860 --> 08:17.050
Now, another option is we can use in our operator and all, but our operator will check both of these

08:17.050 --> 08:17.740
conditions.

08:17.950 --> 08:21.690
And if any one of these conditions is true, it will return to.

08:23.460 --> 08:27.030
Similarly, I can use this type of reader for also.

08:28.190 --> 08:29.450
So it gives a false.

08:30.780 --> 08:37.860
Here, all the do is greater than seven, which is a false statement, and seven greater than nine seven

08:37.860 --> 08:40.620
less than 90 is a true statement.

08:41.880 --> 08:48.370
With this pipe operator, which is used to or it should give desire, that's true, but it is giving

08:48.370 --> 08:57.150
false it as a result because it is creating ambiguity between the list and the then signs present between

08:57.150 --> 08:59.800
seven and seven.

09:00.180 --> 09:04.680
So what we can do here is to make this more clear.

09:05.130 --> 09:07.410
We can use these Brace's.

09:10.860 --> 09:15.900
So once we use these braces and then evaluate, it gives us the results.

09:15.930 --> 09:16.260
Drew.

09:17.780 --> 09:22.070
Or apart from this, we can also do something like this.

09:24.000 --> 09:30.120
Then we can create a chain operator and this chain operator will for the.

09:31.580 --> 09:38.690
Give the result as false, because to greater than seven is a false statement.

09:38.960 --> 09:42.670
So this gives a false while evaluating the complete thing.

09:43.010 --> 09:47.420
But if we want, we can use the other way around, which is with the brackets.

09:47.930 --> 09:49.260
So it works perfectly fine.

09:49.280 --> 09:57.020
So now you can see how we can use different companies and operators to compare different values.

09:57.860 --> 09:58.310
Thank you.
