WEBVTT

00:00.170 --> 00:00.860
Hello guys.

00:00.860 --> 00:04.430
So we are going to continue the discussion with respect to Python programming language.

00:04.430 --> 00:10.340
Now in this first video we are going to probably discuss about syntax and semantics in Python.

00:10.340 --> 00:13.850
So I have given the video outline what all things we are going to cover over here.

00:13.850 --> 00:17.870
So first of all we are going to understand about single line comments and multi-line comments.

00:18.290 --> 00:22.520
Uh, along with this, we are going to understand what is the definition of syntax and semantics.

00:22.550 --> 00:25.670
And then we will see basic syntax rules in Python.

00:25.670 --> 00:31.430
Then we'll also be understanding about semantics in Python and what are the common syntax errors and

00:31.430 --> 00:32.600
how to avoid them.

00:32.630 --> 00:36.740
And we'll also be seeing a lot of practical code examples okay.

00:36.950 --> 00:39.530
Now first of all let's go ahead with the definition over here.

00:39.530 --> 00:46.130
So here you can clearly see that syntax refers to the set of rules that defines the combination of symbols

00:46.130 --> 00:50.240
that are considered to be correctly structured program in a language.

00:50.240 --> 00:55.010
In a simpler terms, syntax is about the correct arrangement of words and symbol in a code.

00:55.400 --> 00:59.090
Now understand when we are doing coding right?

00:59.120 --> 01:02.030
Uh, we usually face some kind of syntax error.

01:02.060 --> 01:04.100
Why it usually happens.

01:04.160 --> 01:08.840
It may be because let's say I have not assigned a variable and I've directly used it, you know, so

01:08.840 --> 01:10.310
I may get a syntax error.

01:10.340 --> 01:14.390
So that is the reason it is written over here, that it is a correct arrangement of words and symbols

01:14.390 --> 01:15.020
in a code.

01:15.050 --> 01:15.590
Right.

01:15.770 --> 01:20.150
Now, uh, this is a basic definition of syntax.

01:20.150 --> 01:24.470
I would also like to give you some more definition for semantics.

01:24.500 --> 01:25.070
Okay.

01:25.070 --> 01:27.230
So let's go ahead and write it over here.

01:27.230 --> 01:32.720
So here you can see semantics refers to the meaning or interpretation of the symbol character and commands

01:32.720 --> 01:33.500
in a language.

01:33.500 --> 01:36.500
It is about what the code is supposed to do when it runs.

01:36.620 --> 01:44.120
Syntax is how we are able to arrange the words so that we write a code, and semantics refers to the

01:44.120 --> 01:45.020
interpretation.

01:45.020 --> 01:52.010
So whatever code, we are specifically writing what it is supposed to do right when it runs, like when

01:52.010 --> 01:55.820
we are trying to run it, what it is supposed to do, it is more about the task that we are trying to

01:55.820 --> 01:56.540
do, right?

01:56.570 --> 01:58.910
And that is what semantics basically refer to.

01:59.060 --> 02:01.250
Now, this is a some kind of basic definition.

02:01.250 --> 02:07.620
I know you usually don't go through this, but I really wanted to explain you in a way that a basic

02:07.620 --> 02:12.690
anyone can actually be able to understand this who is also starting Python programming language?

02:12.720 --> 02:25.440
Okay, now let's go ahead and see some of the basic syntax in Basic syntax rules in Python.

02:25.470 --> 02:26.070
Okay.

02:26.670 --> 02:32.970
Now first first and the foremost important thing is about case sensitivity.

02:33.180 --> 02:33.390
Okay.

02:33.420 --> 02:35.760
So I'm going to write a comment over here.

02:35.820 --> 02:37.110
Case sensitivity.

02:37.140 --> 02:43.080
Now before I go ahead you will be able to see that whenever I use double hash in a code.

02:43.320 --> 02:44.940
See whenever we create a coding cell.

02:44.970 --> 02:45.510
Right.

02:45.510 --> 02:50.370
And if I want to write some kind of comments, a single line comment, I can basically use this double

02:50.400 --> 02:50.970
hash.

02:51.120 --> 02:56.070
So this double hash basically means that whenever I want to use a single line comment, I can just use

02:56.070 --> 02:58.500
this and I can write any kind of comments that I want.

02:58.530 --> 03:03.150
Like I have written over here, let's say that in this code cell I'm going to discuss about basic syntax

03:03.150 --> 03:04.140
rules in Python.

03:04.140 --> 03:06.930
So I have just written double over here okay.

03:07.200 --> 03:11.520
Let's say and there is also an option to use multi-line comments okay.

03:11.670 --> 03:12.900
Now multi-line comments.

03:12.900 --> 03:15.690
Let's say that I have created one test.py file over here.

03:15.840 --> 03:22.710
Now for multi-line comment let's say I'll write this is a multi-line comment or sorry, this double

03:22.770 --> 03:24.450
dash is a single line comment.

03:24.600 --> 03:28.590
And in case of multi-line comment I have to use triple quotes, right?

03:28.620 --> 03:29.640
Something like this.

03:29.640 --> 03:30.720
Triple quotes.

03:30.720 --> 03:37.230
So I will say welcome to the right to the Python course.

03:37.230 --> 03:40.650
So that basically means I'm using 2 to 3 lines and I'm writing this particular lines.

03:40.650 --> 03:40.830
Right.

03:40.860 --> 03:43.800
I'm, I'm, I'm giving some kind of comments over here.

03:43.950 --> 03:49.200
Now whenever I have comments which, which expands to multiple lines, I can definitely use this triple

03:49.200 --> 03:49.830
quotes.

03:49.860 --> 03:55.320
So these are the two ways of writing comments in Python programming language okay.

03:55.470 --> 04:03.600
The reason why I have used this test dot p, y and c again in Python, you can actually use ipynb file,

04:03.600 --> 04:07.030
which is the Jupyter notebook file, or.py file, which is a python file.

04:07.240 --> 04:11.320
Now this triple quotes usually does not work in Jupyter notebook.

04:11.320 --> 04:14.140
It only works in test.py file, right?

04:14.170 --> 04:19.810
Other than that, single line comments definitely work for both Jupyter notebook and the py file.

04:19.840 --> 04:21.160
Basically the Python file.

04:21.250 --> 04:26.410
So I hope you got an idea of understanding about single line comments and multi-line comments.

04:27.700 --> 04:31.000
Now let's go ahead and see some of the basic syntax in Python.

04:31.210 --> 04:36.010
So first point that I really want to talk about is case sensitivity.

04:36.250 --> 04:44.290
And to give you a good comment over here Python is case sensitive.

04:44.290 --> 04:47.950
So guys now let me go ahead and define a variable.

04:47.950 --> 04:50.200
Let's say this is a variable.

04:50.680 --> 04:52.060
And what exactly is a variable.

04:52.060 --> 04:53.260
Again I will give a definition.

04:53.260 --> 04:57.430
But let's consider that a variable is something that stores some information.

04:57.460 --> 04:58.000
Okay.

04:58.060 --> 05:01.480
Let's say in this particular variable I define my name.

05:01.480 --> 05:02.290
That is Chris.

05:02.320 --> 05:02.950
Okay.

05:03.010 --> 05:09.420
And let's say I again define a variable with capital n, and I write the same variable name that is

05:09.420 --> 05:10.080
name.

05:10.080 --> 05:13.230
And here let's say that I am just going to use another name.

05:13.230 --> 05:14.850
Let's say Nick okay.

05:15.630 --> 05:24.000
Now one thing that you really need to know, if I print this particular name and if I print the next

05:24.000 --> 05:27.030
name right over here.

05:27.030 --> 05:30.360
Both this name are different variables, right?

05:30.360 --> 05:34.740
It is not the same variable, even though even though the variable meaning is same.

05:34.740 --> 05:34.980
Right.

05:35.010 --> 05:35.670
Name name.

05:35.670 --> 05:36.180
Right.

05:36.180 --> 05:40.710
But I've told over here that Python is case sensitive, right?

05:40.740 --> 05:45.570
That basically means both these variable are different identifiers.

05:45.600 --> 05:46.230
Okay.

05:46.650 --> 05:51.660
So if I am going to execute this here, you can see the first name is displaying Krish and the second

05:51.660 --> 05:52.890
name is displaying Nick.

05:52.920 --> 05:53.580
Right.

05:53.580 --> 05:58.380
So that is the reason we say that hey Python is case sensitive right.

05:58.380 --> 05:59.880
Both this variable.

05:59.910 --> 06:00.420
Right.

06:00.420 --> 06:06.800
If we are writing we always need to make sure that, uh, you know, let's say that I have defined this

06:06.800 --> 06:07.460
name over here.

06:07.460 --> 06:13.460
And again, I have defined name, uh, unless and until both this, both this variable are having that

06:13.460 --> 06:14.570
case sensitive things.

06:14.600 --> 06:14.900
Right.

06:14.900 --> 06:20.270
That basically means if I, even though I'm writing with the small, uh, small n later letter over

06:20.270 --> 06:24.230
here, then I will be considering both this variable as same.

06:24.260 --> 06:26.900
Otherwise this will be treated as a different identifier.

06:26.930 --> 06:27.110
Right.

06:27.140 --> 06:29.840
So this is one of the very much important information.

06:29.840 --> 06:31.850
Now coming to the second thing right.

06:31.880 --> 06:35.660
Second point let's talk about something called as indentation.

06:36.140 --> 06:37.340
Right now.

06:37.340 --> 06:39.230
What exactly is indentation okay.

06:39.230 --> 06:41.660
And this is also very much important to understand.

06:42.620 --> 06:44.210
I'll just write a comment over here.

06:44.390 --> 06:48.290
Python uses indentation to define blocks of code.

06:48.440 --> 06:50.360
Consistent use of space.

06:50.510 --> 06:53.120
Commonly four spaces or a tab is required.

06:53.150 --> 06:56.000
Okay, now what exactly is indentation?

06:56.030 --> 06:56.540
Okay.

06:56.540 --> 07:02.330
And if you really want to have a definition for indentation okay.

07:02.540 --> 07:05.660
Uh, so we can also define indentation over here.

07:05.660 --> 07:08.470
So let me just go ahead and give you some kind of definition.

07:08.500 --> 07:08.680
Okay.

07:08.710 --> 07:10.390
I will be using a markdown cell.

07:10.390 --> 07:12.610
And let me just go ahead and write over here.

07:12.640 --> 07:13.090
Right.

07:13.090 --> 07:16.900
And let's go through this particular indentation definition.

07:18.700 --> 07:20.470
So let me just go ahead and execute.

07:20.470 --> 07:24.610
Indentation in Python is used to define the structure and hierarchy of the code.

07:24.640 --> 07:30.550
Unlike many other programming language that uses braces to delimit block of codes.

07:30.580 --> 07:30.940
Right.

07:30.970 --> 07:34.720
Python uses indentation to determine the grouping of statement.

07:34.750 --> 07:40.870
Okay, now indentation is something that is very much necessary whenever you are writing some clauses.

07:40.900 --> 07:44.020
Let's say if block or for loop or something else.

07:44.050 --> 07:44.590
Right.

07:44.590 --> 07:48.790
So let's say I'll give you an example over here, I will I will define a variable.

07:48.790 --> 07:50.740
Let's say age is equal to 32.

07:50.770 --> 07:53.260
And let me just go ahead and write one if condition.

07:53.260 --> 07:56.500
Don't worry if you don't know about if condition how do we write it?

07:56.530 --> 07:57.850
What is the syntax and all?

07:57.880 --> 08:04.330
I will explain this as we go ahead, but I just want to give you an idea about indentation.

08:04.330 --> 08:08.670
So let's say if I write if age is equal to greater than 30.

08:09.180 --> 08:14.460
Now, when I write, if age is greater than 30, and if I just use this colon now see what will happen

08:14.460 --> 08:20.580
if I press enter, it is going to start inside this particular block and automatically it did not start

08:20.580 --> 08:21.450
from here.

08:21.450 --> 08:23.220
Instead it started from here.

08:23.250 --> 08:23.850
Right?

08:23.850 --> 08:26.160
So it is what it is basically doing.

08:26.160 --> 08:28.500
It is using indentation, right?

08:28.530 --> 08:31.920
It is using consistent use of space commonly for or tab.

08:31.950 --> 08:32.520
Right.

08:32.520 --> 08:35.880
And here it is for a block of statement right.

08:35.910 --> 08:36.810
Block of code.

08:36.840 --> 08:37.440
Right.

08:37.530 --> 08:42.300
So here if I am going to write, let's say that I'm going to print 30 over here.

08:42.960 --> 08:46.800
And I'm just going to print the age right now what is basically happening over here?

08:46.800 --> 08:50.520
I have just used this uh, if block.

08:50.550 --> 08:51.120
Right.

08:51.180 --> 08:56.760
And because of indentation, we know that this code is only going to get executed when this is true.

08:56.820 --> 08:57.450
Okay.

08:57.480 --> 09:03.630
If I go ahead outside and if I print it print age, that basically means this is not inside the if clause,

09:03.660 --> 09:04.290
right?

09:04.320 --> 09:08.300
Usually in other programming languages we usually write this kind of braces.

09:08.300 --> 09:08.570
Right.

09:08.570 --> 09:10.610
We we try to define this kind of braces.

09:10.610 --> 09:14.360
If you know other programming languages like C plus plus or C sharp.

09:14.390 --> 09:14.840
Right.

09:14.840 --> 09:20.420
But in Python instead of using this braces automatically it will be aligned with indentation.

09:20.690 --> 09:23.300
Now let me just go ahead and execute it this time.

09:23.300 --> 09:27.650
Two times is basically getting displayed 32 so one is this and the other one is over here.

09:27.800 --> 09:33.020
Understand this age is basically getting displayed but this is outside the if block okay.

09:33.110 --> 09:39.710
So this is giving you an idea about indentation okay I have already explained you about comments, but

09:39.710 --> 09:42.290
let me just go ahead and write about single comments.

09:42.290 --> 09:43.670
So first single comment.

09:43.700 --> 09:45.740
Let's say this is a single line comment.

09:45.740 --> 09:49.040
I'll go ahead and write single line comment.

09:50.090 --> 09:54.740
Let's say that I'm going to print Hello World.

09:55.310 --> 09:59.630
Okay, now if I go ahead and execute this, you can see only Hello World is getting displayed.

09:59.630 --> 10:05.030
This this comment section is not getting printed right again, why do we write comments?

10:05.030 --> 10:06.500
Let's say that I want to define a function.

10:06.500 --> 10:08.980
I want to give some information about this particular function.

10:08.980 --> 10:11.350
I can write all those info in this comment section.

10:11.380 --> 10:14.410
Okay, now this is important.

10:14.440 --> 10:18.790
Okay, now let me just go ahead and talk more about different, different syntaxes.

10:18.790 --> 10:22.120
One more syntax is something called as line continuation.

10:22.810 --> 10:25.660
So here I'm going to basically write line continuation.

10:26.800 --> 10:28.780
Now what exactly is line continuation.

10:28.810 --> 10:33.940
Okay let's say I am going to create a variable total okay.

10:33.970 --> 10:42.400
And I'm doing some mathematical operation like one plus two plus three plus four plus five plus six

10:42.400 --> 10:43.570
plus seven.

10:43.570 --> 10:46.270
Let's say this line is becoming bigger and bigger, right?

10:46.480 --> 10:48.880
So this line is really becoming bigger and bigger.

10:48.880 --> 10:50.500
Let's say I want to go to the next line.

10:50.500 --> 10:55.720
So what I can actually do let's say I will write plus and now I will use a black slash.

10:55.750 --> 10:59.680
Now if I use a backslash and if I press enter then what is going to happen.

10:59.680 --> 11:01.690
It is just going to continue in the new line.

11:01.720 --> 11:02.230
Okay.

11:02.230 --> 11:06.670
So here I will just use this and then let me go ahead and press backslash.

11:06.670 --> 11:11.100
And let's say I go ahead and add more elements like four plus five plus six.

11:11.130 --> 11:17.460
Now if I go ahead and print total, you'll be able to see this will also do all the operations.

11:17.460 --> 11:30.180
So if I do the calculation 1318, 22, 25, 27, 28, 28 and 28, plus six, 34, 39, 43, right.

11:30.210 --> 11:35.970
And I'm able to get the answer so you can use right.

11:36.000 --> 11:41.790
In case of uh, basically line continuation, you can basically use a backslash.

11:41.820 --> 11:42.510
Right.

11:42.510 --> 11:45.780
And you can continue the statement to the next line.

11:45.810 --> 11:46.200
Okay.

11:46.230 --> 11:47.850
So this is very much important.

11:47.850 --> 11:49.860
Again one of the most amazing feature.

11:50.850 --> 11:53.310
And again let me just show you one more thing.

11:53.400 --> 11:56.070
One more amazing thing with respect to syntax and semantics.

11:56.070 --> 12:01.440
Uh, that is nothing but multiple statements on a single line.

12:03.600 --> 12:04.380
On a single line.

12:04.380 --> 12:05.820
Now, what does this basically mean?

12:05.820 --> 12:08.190
Let's say I want to assign one value.

12:08.190 --> 12:09.390
Let's say x is equal to five.

12:09.390 --> 12:11.780
I have defined I want to define another variable.

12:11.780 --> 12:13.280
Let's say y is equal to ten.

12:13.610 --> 12:17.030
Again if I want to define another variable I'll use the colon.

12:17.150 --> 12:19.760
And I'll go ahead and write x is equal to x plus y.

12:20.090 --> 12:25.340
Now what is basically happening in a single line of code in a single line I've used multiple statement.

12:25.370 --> 12:28.850
I've assigned x is equal to five, y is equal to ten, Z is equal to x plus y.

12:28.970 --> 12:35.120
Now if I go ahead and print z you see I will be able to get the answer.

12:35.150 --> 12:37.940
So ten plus five is equal to nothing but 15 right.

12:38.030 --> 12:42.920
So guys now here you can see that this kind of operation can also be performed right.

12:42.950 --> 12:47.000
Now let's go ahead and understand semantics okay.

12:47.570 --> 12:49.520
And here also I'm going to put some points.

12:49.520 --> 12:54.740
So understanding semantics in Python okay.

12:54.980 --> 12:59.480
Now the first thing that we are going to understand is about variable assignment.

12:59.540 --> 13:03.170
So what exactly is variable assignment.

13:03.950 --> 13:08.150
Let's say that I define a variable like age is equal to 32.

13:08.180 --> 13:08.810
Okay.

13:09.620 --> 13:13.450
So here when we run this particular command, right?

13:13.750 --> 13:19.180
When we run this line of code, then in other programming languages, you usually define the data type

13:19.180 --> 13:21.910
beforehand, like int age, float age.

13:21.940 --> 13:27.130
But here in Python the kernel automatically understands during the runtime.

13:27.130 --> 13:32.770
So here the kernel will understand that age is an integer, because here we are assigning some integer

13:32.770 --> 13:33.370
value.

13:33.760 --> 13:37.540
Similarly, let's say I go ahead and write name is equal to Chris.

13:38.290 --> 13:41.740
So here you will be able to see that name will be a string right.

13:41.770 --> 13:43.120
So name is a string.

13:43.270 --> 13:45.670
So I will just go ahead and execute this.

13:46.450 --> 13:51.310
If you want to understand whether I am probably how to probably check the type of this.

13:51.310 --> 13:53.440
So I will go ahead and write type of age.

13:53.470 --> 13:55.330
And let me just go ahead and execute it.

13:55.330 --> 13:58.480
So here you'll be able to see that hey I'm getting an integer value.

13:59.350 --> 14:01.720
So this basically indicates that age is an integer.

14:01.750 --> 14:05.350
Then if I go ahead and execute type of name.

14:05.350 --> 14:09.640
So here you'll be able to see that hey it is an STR type that is nothing but string type.

14:10.450 --> 14:13.350
Now uh, let me do one thing.

14:13.980 --> 14:14.580
Okay.

14:14.970 --> 14:19.590
Uh, this the type that we have actually run, right?

14:19.620 --> 14:23.250
It is also called as something called as type inferencing.

14:23.520 --> 14:26.340
So here I'm going to basically write type inference.

14:27.150 --> 14:32.280
Now Python infers the type of a variable at the runtime.

14:32.280 --> 14:35.490
And this is basically allowing dynamic typing.

14:35.520 --> 14:35.730
Okay.

14:35.760 --> 14:38.340
So what does it basically mean over here.

14:38.340 --> 14:43.530
Is that uh okay I will just use this in the other code.

14:43.530 --> 14:44.280
Let's see.

14:45.390 --> 14:48.240
So if I go ahead and write over here I'll create a variable.

14:48.300 --> 14:50.070
Variable is equal to ten.

14:50.100 --> 14:50.670
Okay.

14:50.970 --> 14:57.030
And let's say I go ahead and write print type of var right.

14:57.330 --> 14:59.550
As sorry this will be variable.

14:59.580 --> 15:00.120
Okay.

15:00.660 --> 15:02.520
Now what is basically going to happen over here.

15:02.520 --> 15:08.520
Once you probably execute this you are able to get an answer saying that hey it is of int type and the

15:08.520 --> 15:10.110
class will be int okay.

15:10.380 --> 15:17.480
But if I go ahead and use the same variable and assign some other name or some other value.

15:17.510 --> 15:18.500
Let's say Chris.

15:19.490 --> 15:26.330
Now if I go ahead and print the type of variable, now what I'm actually going to get right.

15:26.330 --> 15:31.520
So here you'll be able to see that I will be able to get str for the same variable itself.

15:31.550 --> 15:32.180
Right.

15:32.270 --> 15:38.660
So here you'll be able to see that whenever we refer to the type of this specific variable, we will

15:38.690 --> 15:41.060
be also able to see something very amazing.

15:41.060 --> 15:46.790
As we keep on changing this particular variable we will be also able to see the inferencing type right.

15:46.820 --> 15:50.690
So basically when we are searching for type of this it is basically showing different different things.

15:50.690 --> 15:55.670
So that basically means what during the runtime you can change the type of the variable with different

15:55.670 --> 15:57.380
different values okay.

15:58.250 --> 16:02.540
Now this was one of the most amazing thing with respect to semantics.

16:02.570 --> 16:03.170
Okay.

16:03.620 --> 16:09.860
Uh, and uh, as, as, you know, something, uh, over here is that we also need to understand that

16:09.890 --> 16:14.170
what happens, uh, in the case of indentation error, let's say if I go ahead and write, age is equal

16:14.170 --> 16:19.180
to 32, and if I write if age is greater than 30, okay.

16:19.210 --> 16:23.320
And if I go ahead and execute it and let's say I don't use this indentation.

16:23.320 --> 16:26.830
Instead I start from here and I go ahead and write print age.

16:26.860 --> 16:31.750
So here clearly you will be getting an error saying that hey indentation error expected and indented

16:31.750 --> 16:34.150
block after if statement on line two.

16:34.180 --> 16:36.220
So this is how you will be able to understand it.

16:36.250 --> 16:40.480
All I have to do is that start from this and automatically you'll be able to see the answer.

16:41.110 --> 16:41.650
Okay.

16:42.310 --> 16:44.440
Uh, this is important.

16:44.470 --> 16:46.180
Uh, otherwise, uh.

16:46.180 --> 16:46.810
Understand?

16:46.810 --> 16:48.880
Without indentation, things will not work out.

16:48.880 --> 16:53.770
Even though you create classes, even though you create functions, whenever you write a block of codes

16:53.770 --> 16:58.180
within some kind of blocks itself, like an if statement for loop or while loop.

16:58.180 --> 17:00.790
So indentation is specifically required there.

17:00.790 --> 17:03.790
You do not explicitly need to use brackets.

17:04.570 --> 17:09.730
Now, uh, one more thing, one more syntax error, which usually people do.

17:09.760 --> 17:13.150
Let's say I have defined a is equal to B and you know that B is not defined.

17:13.180 --> 17:18.090
So if I go ahead and execute this, this is also kind of syntax error because name B is not defined

17:18.090 --> 17:18.570
over here.

17:18.600 --> 17:18.750
Right.

17:18.780 --> 17:22.470
So this basically becomes a unknown variable right.

17:22.500 --> 17:28.260
So this is nothing but this is basically called as a name error okay.

17:28.350 --> 17:33.930
I'll be showing you as we go ahead uh with respect to exception handling and how do we handle all these

17:33.930 --> 17:34.440
things.

17:34.440 --> 17:35.850
We'll be talking more about it.

17:35.880 --> 17:36.390
Okay.

17:36.600 --> 17:38.490
Now let me do one thing.

17:38.520 --> 17:42.360
Let me just show you one amazing example of indentation.

17:42.360 --> 17:45.240
Some code example of indentations.

17:45.390 --> 17:46.050
Okay.

17:46.170 --> 17:52.440
And again, uh, after this session, also I will be giving you a lot of, uh, quizzes, assignments,

17:52.440 --> 17:54.480
practice sessions and all.

17:54.480 --> 17:56.550
You just need to go ahead and do it okay.

17:56.580 --> 17:57.390
Practice it.

17:57.390 --> 17:59.190
So here if I write if true.

17:59.220 --> 18:01.050
So true is a kind of a boolean variable.

18:01.050 --> 18:03.630
I will be talking more about variables in our next session.

18:03.690 --> 18:05.580
Let's say I go ahead and print.

18:06.360 --> 18:10.620
This is my correct indentation right indentation.

18:10.710 --> 18:14.040
So here uh this this basically becomes my statement.

18:14.040 --> 18:17.630
And print is just to print anything in your output console.

18:17.660 --> 18:18.200
Okay.

18:18.410 --> 18:21.320
Now inside this true, let's say I have another condition.

18:21.320 --> 18:22.700
If false.

18:22.970 --> 18:28.430
Now, if I want to write any print statement inside this block, then I have to again do an indentation.

18:28.430 --> 18:29.570
So here we go ahead and write.

18:29.600 --> 18:32.480
Print this one print.

18:32.510 --> 18:34.160
Write this one print.

18:34.160 --> 18:36.980
Why it will not print because by default it is true.

18:37.010 --> 18:38.480
This is going to print.

18:38.990 --> 18:42.560
It is going to check this condition and is going to come out of this particular condition.

18:42.560 --> 18:43.010
Right.

18:43.010 --> 18:48.380
And finally you'll be able to see that I'm printing one more thing over here saying that whether this

18:48.380 --> 18:52.490
will print or not, you just think, okay, this will obviously print, right?

18:52.490 --> 18:54.140
Because this is not getting executed.

18:54.140 --> 18:55.460
We are not going inside this.

18:55.460 --> 18:57.860
And finally, this print statement will execute.

18:57.890 --> 19:03.260
Now, if I want to go outside the if clause, then this will be another print statement.

19:03.290 --> 19:03.830
Right.

19:03.860 --> 19:08.540
And I can basically say outside the if block.

19:09.140 --> 19:14.540
So how many times print is going to just pause the video and understand how many times the print statement

19:14.540 --> 19:16.460
is going to execute it, right three times.

19:16.460 --> 19:17.900
So if I go ahead and execute it.

19:17.930 --> 19:19.670
You'll be able to see correct indentation.

19:19.670 --> 19:21.770
This will print outside the if block.

19:21.800 --> 19:22.280
Okay.

19:22.280 --> 19:24.950
So this is basically going to get printed right.

19:24.950 --> 19:28.640
So these are some of the amazing examples of indentation okay.

19:30.170 --> 19:32.030
Now let me do one thing.

19:32.030 --> 19:33.800
Let me show you one more thing.

19:33.830 --> 19:34.430
Right.

19:34.700 --> 19:40.520
Um one is with respect to correct variable assignment and uh, type inference.

19:40.520 --> 19:45.920
But before I go ahead and explain you more about this, this is some basics about syntax and semantics.

19:46.250 --> 19:50.300
Uh, now as we go ahead, what all things we basically covered single line comments, multi-line comments,

19:50.300 --> 19:53.210
definition syntax and semantics, basic syntax rules.

19:53.210 --> 19:55.070
How do you define a variable?

19:55.070 --> 19:59.810
What is case sensitive and all everything I've actually covered over here.

19:59.840 --> 20:00.050
Right.

20:00.080 --> 20:06.110
This actually gives you an idea about, uh, you know, the basic differences between syntax and semantics

20:06.110 --> 20:06.710
also.

20:06.740 --> 20:08.300
So I hope you like this particular video.

20:08.300 --> 20:13.520
In the next video I am going to talk about, uh, variables, then data types, then operators.

20:13.550 --> 20:14.030
Right.

20:14.030 --> 20:15.560
So yes, this was it from my side.

20:15.560 --> 20:17.000
I will see you in the next video.

20:17.000 --> 20:17.300
Thank you.
