WEBVTT

00:00.880 --> 00:03.280
Let's learn condition in Python.

00:03.600 --> 00:07.280
Python supports the usual logical condition from mathematics.

00:07.440 --> 00:08.240
Okay.

00:08.280 --> 00:09.360
Very easy.

00:09.400 --> 00:13.800
For example, we have a which is equal to b.

00:13.840 --> 00:17.800
So this is called equals or it shows equality.

00:18.640 --> 00:25.680
And we have other one which is a not equal to b.

00:25.680 --> 00:28.560
This is this means that it is.

00:28.560 --> 00:30.320
This both is not equal.

00:30.520 --> 00:32.200
So that is it.

00:32.200 --> 00:37.000
And also we have less than a a less than b.

00:37.000 --> 00:39.920
So is called a less than b.

00:41.760 --> 00:46.760
And we have a greater than b okay.

00:47.240 --> 00:53.800
And also we have a less than or equal to.

00:54.880 --> 01:02.680
So less than or equal to b a less than or equal to b okay.

01:03.320 --> 01:12.520
And also we have greater than or equal to a greater than or equal to b.

01:13.240 --> 01:17.010
Now In a logical or in condition.

01:17.010 --> 01:24.130
We have this option that we are going to be using them and it is very easy.

01:24.250 --> 01:25.010
Don't be worried.

01:25.050 --> 01:26.850
You're going to just learn it okay.

01:27.450 --> 01:29.730
So let's go with an example.

01:29.770 --> 01:37.290
A is equal to for example 12 b is equal to a number which is this one.

01:37.330 --> 01:39.490
Now I am going to use an if condition.

01:39.690 --> 01:47.570
If for example A is equal a is greater than B, then printed text like a is greater.

01:48.130 --> 01:52.930
But if not, then print B is greater.

01:53.090 --> 01:54.250
So how can we do that?

01:54.490 --> 02:00.370
Let's use if this is how we write the if condition okay.

02:00.410 --> 02:00.890
We use.

02:00.890 --> 02:06.410
If A is greater than B then use colon.

02:06.410 --> 02:07.170
Hit enter.

02:07.570 --> 02:09.210
Be careful about this space.

02:09.250 --> 02:12.170
It is called indentation in Python okay.

02:13.010 --> 02:15.570
And this print a text here.

02:15.570 --> 02:20.370
For example a is greater.

02:21.010 --> 02:21.410
Okay.

02:22.010 --> 02:23.530
A is greater.

02:23.570 --> 02:27.570
Right now it is just the if condition right now if I execute this.

02:27.570 --> 02:34.030
So you see that it is not greater than B, then it will not print anything at all.

02:34.710 --> 02:34.950
So?

02:36.390 --> 02:41.870
So we have to handle the other option which is else part.

02:41.950 --> 02:46.670
Now let's use Python condition.

02:46.670 --> 02:48.510
And you see we have nothing.

02:49.190 --> 02:52.870
And let me use the else part.

02:52.910 --> 02:56.070
Else is going to be here in else part.

02:56.110 --> 03:02.030
I am going to print that B is greater.

03:02.470 --> 03:06.750
Now I save this and hit enter.

03:06.750 --> 03:08.590
You see B is greater.

03:09.150 --> 03:13.590
What if I change the number to a number like this?

03:17.030 --> 03:22.630
Now you see that a is greater before it was B is greater.

03:22.670 --> 03:27.710
So it is how we can use conditions in Python okay.

03:27.750 --> 03:36.790
It is one of the very simple example of a condition and if condition in Python.

03:36.790 --> 03:41.670
So let's go and learn this with more details in the future.

03:41.790 --> 03:43.110
So see you there.
