Now that you know how to execute your first program, let's move for the next part, which is Python
variable.
Okay, so let me create a new file.
Okay.
Right here I'm going to create a new file.
It is going to be variables.py okay.
How can we create a variable or first what is a variable.
Okay.
Uh what is a variable okay.
Are variable or variables.
Are containers okay for storing data values.
Okay.
For example we have x which is equal to a number like 34 right.
Now this x it is a variable okay.
That contains or store this data which is 34 inside x okay.
Whenever I use x it will give me a value which is 34.
And that is all.
This is all about variable.
Not really.
We have more about variables okay.
Let me show you here.
Okay.
So x is equal to 34.
It's a variable that contains integer.
Okay.
Integer is a number.
Okay.
Any number could have could be integer.
And also we have something else like name.
It is equal to.
For example name it.
Okay.
So now name is also a variable that contain a string.
This is called string.
Anything that has these quotation marks or strings.
Okay.
Now this name is a value for this okay.
For this variable name that is a value for name.
Now if I want to see the value for this board I could use print.
And then let's see x.
So let's save it.
And here let me use Python variable.py hit enter.
Now you see we have 34 right here.
And what if I see if I want to see name here.
And this time it must give me name okay.
See.
So these are variables.
And Also, there is some rule that you need to be careful about them while naming a variable.
Okay.
For example, our label name must start with a letter or an underscore.
For example, you see here okay name it name starts with n n is a letter okay.
And also it will start with underscore okay.
Now it's also okay.
And it will not give me an error if I execute this.
Let's see.
A name is defined.
Did you mean name okay.
That is here.
See right now I'm printing name.
And there is no name like this.
I must add an underscore at the beginning.
Now.
Now if I execute this, it will give me name.
Okay.
So the first rule, the first number, the first letter could be a letter or underscore is one of the
rule.
The second rule is a variable name.
Cannot start with a number okay.
For example if you give two here And also to hear now if I execute this, it will give me an error.
And you see that it says syntax error invalid decimal literal.
Okay.
That is because I use a number at the beginning of a variable.
Okay.
Name of variable.
You cannot use name a number at the beginning of a variable.
This is the second one.
And let's go with the third one.
Our variable name can only contain alpha numeric character and underscore.
And that is all.
How it can contain okay letter or alphabet from A to Z.
Number from 0 to 9 and underscore okay.
It cannot contain something like dollar sign or something like this.
It cannot contain them okay.
So this is the third one.
And the fourth one is variable names are case sensitive.
It is very important.
For example we have h which is equal to.
For example 12 okay.
And also we have another edge with capital A and it is equal to for example, 90.
Now if I print.
For example h it will give me 12 because these two are not the same okay.
And variable names are case sensitive.
Now if I execute and run the other one which is this one, and this time you know that it will give
me, uh, other thing.
Let me save it first and then run it.
You see, this is the number which is a value for age with capital A.
So this was about how you can create a variable and also for rules, uh, about naming a variable.
Okay.
So this was all about variable.
I hope you learn it.
And through the course you will learn it a lot because we are in each lecture we are using variables.
Okay.
So if you don't get it don't be worried because because you will get it okay.
It is very easy.
So I will see in the next lecture.