WEBVTT

00:00.960 --> 00:06.680
Now that you know how to execute your first program, let's move for the next part, which is Python

00:06.680 --> 00:07.200
variable.

00:07.240 --> 00:10.200
Okay, so let me create a new file.

00:10.560 --> 00:11.000
Okay.

00:12.200 --> 00:14.080
Right here I'm going to create a new file.

00:14.080 --> 00:19.440
It is going to be variables.py okay.

00:19.480 --> 00:22.240
How can we create a variable or first what is a variable.

00:22.280 --> 00:22.640
Okay.

00:24.280 --> 00:26.240
Uh what is a variable okay.

00:29.720 --> 00:32.160
Are variable or variables.

00:32.280 --> 00:37.160
Are containers okay for storing data values.

00:37.440 --> 00:38.360
Okay.

00:38.400 --> 00:45.760
For example we have x which is equal to a number like 34 right.

00:45.800 --> 00:48.560
Now this x it is a variable okay.

00:48.600 --> 00:55.160
That contains or store this data which is 34 inside x okay.

00:55.200 --> 00:59.840
Whenever I use x it will give me a value which is 34.

00:59.880 --> 01:00.560
And that is all.

01:00.560 --> 01:02.560
This is all about variable.

01:02.600 --> 01:03.440
Not really.

01:04.200 --> 01:07.480
We have more about variables okay.

01:09.440 --> 01:11.940
Let me show you here.

01:11.980 --> 01:12.700
Okay.

01:12.740 --> 01:14.580
So x is equal to 34.

01:14.620 --> 01:16.820
It's a variable that contains integer.

01:16.860 --> 01:17.540
Okay.

01:17.580 --> 01:18.940
Integer is a number.

01:18.980 --> 01:19.260
Okay.

01:19.300 --> 01:21.620
Any number could have could be integer.

01:22.340 --> 01:26.180
And also we have something else like name.

01:26.220 --> 01:27.620
It is equal to.

01:27.660 --> 01:29.100
For example name it.

01:29.140 --> 01:29.700
Okay.

01:29.740 --> 01:32.620
So now name is also a variable that contain a string.

01:32.780 --> 01:34.180
This is called string.

01:34.260 --> 01:38.100
Anything that has these quotation marks or strings.

01:38.140 --> 01:38.780
Okay.

01:38.820 --> 01:43.420
Now this name is a value for this okay.

01:43.460 --> 01:46.460
For this variable name that is a value for name.

01:47.580 --> 01:52.220
Now if I want to see the value for this board I could use print.

01:52.220 --> 01:53.540
And then let's see x.

01:54.100 --> 01:56.540
So let's save it.

01:56.780 --> 02:03.260
And here let me use Python variable.py hit enter.

02:03.300 --> 02:06.300
Now you see we have 34 right here.

02:06.860 --> 02:11.140
And what if I see if I want to see name here.

02:11.140 --> 02:15.180
And this time it must give me name okay.

02:15.220 --> 02:15.620
See.

02:16.580 --> 02:17.820
So these are variables.

02:18.060 --> 02:28.160
And Also, there is some rule that you need to be careful about them while naming a variable.

02:28.200 --> 02:28.760
Okay.

02:28.800 --> 02:34.000
For example, our label name must start with a letter or an underscore.

02:34.240 --> 02:41.000
For example, you see here okay name it name starts with n n is a letter okay.

02:42.120 --> 02:46.320
And also it will start with underscore okay.

02:46.360 --> 02:47.680
Now it's also okay.

02:47.920 --> 02:50.800
And it will not give me an error if I execute this.

02:51.640 --> 02:52.200
Let's see.

02:54.600 --> 02:56.520
A name is defined.

02:56.560 --> 02:58.680
Did you mean name okay.

02:58.920 --> 02:59.840
That is here.

02:59.880 --> 03:01.680
See right now I'm printing name.

03:01.680 --> 03:03.760
And there is no name like this.

03:03.760 --> 03:05.960
I must add an underscore at the beginning.

03:06.400 --> 03:06.800
Now.

03:09.480 --> 03:11.920
Now if I execute this, it will give me name.

03:12.080 --> 03:12.480
Okay.

03:12.800 --> 03:20.320
So the first rule, the first number, the first letter could be a letter or underscore is one of the

03:20.320 --> 03:20.600
rule.

03:20.600 --> 03:22.880
The second rule is a variable name.

03:22.920 --> 03:25.160
Cannot start with a number okay.

03:25.200 --> 03:33.740
For example if you give two here And also to hear now if I execute this, it will give me an error.

03:34.380 --> 03:39.340
And you see that it says syntax error invalid decimal literal.

03:39.380 --> 03:39.740
Okay.

03:40.020 --> 03:44.020
That is because I use a number at the beginning of a variable.

03:44.060 --> 03:44.540
Okay.

03:44.580 --> 03:45.500
Name of variable.

03:45.540 --> 03:51.540
You cannot use name a number at the beginning of a variable.

03:51.660 --> 03:52.740
This is the second one.

03:52.900 --> 03:55.380
And let's go with the third one.

03:55.420 --> 04:01.820
Our variable name can only contain alpha numeric character and underscore.

04:02.940 --> 04:04.460
And that is all.

04:05.700 --> 04:13.580
How it can contain okay letter or alphabet from A to Z.

04:13.620 --> 04:16.540
Number from 0 to 9 and underscore okay.

04:16.580 --> 04:20.940
It cannot contain something like dollar sign or something like this.

04:21.220 --> 04:22.780
It cannot contain them okay.

04:23.380 --> 04:24.580
So this is the third one.

04:24.580 --> 04:27.980
And the fourth one is variable names are case sensitive.

04:28.140 --> 04:29.300
It is very important.

04:29.340 --> 04:32.020
For example we have h which is equal to.

04:35.180 --> 04:36.620
For example 12 okay.

04:36.820 --> 04:43.480
And also we have another edge with capital A and it is equal to for example, 90.

04:43.520 --> 04:45.120
Now if I print.

04:47.240 --> 04:54.480
For example h it will give me 12 because these two are not the same okay.

04:54.520 --> 04:58.040
And variable names are case sensitive.

04:58.080 --> 05:06.040
Now if I execute and run the other one which is this one, and this time you know that it will give

05:06.040 --> 05:08.480
me, uh, other thing.

05:08.520 --> 05:11.960
Let me save it first and then run it.

05:12.040 --> 05:17.280
You see, this is the number which is a value for age with capital A.

05:17.320 --> 05:26.400
So this was about how you can create a variable and also for rules, uh, about naming a variable.

05:26.440 --> 05:26.880
Okay.

05:27.200 --> 05:29.160
So this was all about variable.

05:29.360 --> 05:31.040
I hope you learn it.

05:31.040 --> 05:37.520
And through the course you will learn it a lot because we are in each lecture we are using variables.

05:37.560 --> 05:38.360
Okay.

05:38.400 --> 05:44.680
So if you don't get it don't be worried because because you will get it okay.

05:44.720 --> 05:45.960
It is very easy.

05:45.960 --> 05:47.400
So I will see in the next lecture.
