Guys will come back in this to do.
We are going to learn about why he was so variables.
The fundamental concept in almost every programming language, and they are used in almost every programming
language as well.
So what is the definition of a variable?
So the simple definition of a variable can be container's used to store data.
So variables are just containers used to store data values in a remote location.
So get the best metaphor for this can be 10 variables like a box Nymagee and the value is data stored
in that box.
And these data values can be of any day today.
We are going to see that in the next tutorials.
But right now, just remember that variables are used to store data, at least in remote locations.
OK, so how can we declare the variables in Python?
So the thing is, we don't need to declare the variables or initialize the variables in Python.
We just need to name the variable and assign them to look at that variable.
And not declaring and not initializing variables means we don't need any keywords to include the variables
in Python.
OK, like in other languages, we need some sort of some sort of keywords, particularly the variables
like in JavaScript.
We need wildly to continue to duplicate the variable.
But in Python we don't need such cures.
We just need to give a name to the variable.
And then I say, know how to do that.
Now we are going to see how to do that.
Now, here is a variable student and we are going to assign the value to this variable now.
But I say no value to the variable.
This equals sign or the whole assignment operator is used in Python.
OK, so it's operator and then the value, let's say, values there.
So this is a value.
So this is a declaration of of variables in Python.
Now, what will happen when we run this program?
Python interpreter will look at some memory space to store this value in that memory space.
OK, and then you would have this variable student will just act like a label to this very same label
or placeholder to this value.
OK, and we can use this variable anywhere in our program.
This doesn't really work anywhere in our program to get access to this value sample.
OK, and now we are able to get all this variable.
So to get the output, we use the print function in part, OK, print function is used in by the.
So to get output of this variable print and then variable, which is a student student and we don't
have to use quotes here because it's not a string, it is a variable look.
So print student and then if we run this we will get output in the terminal.
OK, so it is all put in the.
Now, let's do this variable studen to different value.
OK, so student and let's say June and if so, what what do you think will be the output of this program?
Is it going to be the same or is it going to be this June?
So let's see.
So June will be printed in the journal.
So why?
Because the Python interpreter executed the code line by line.
So this student, this variable, this value will be updated in this very well.
Okay.
Well, if again, change this value to something else, update this variable to John List here, John.
And if I bring this again, John will continue to remember this python interpreter.
We're always going to print the last object to the value of the variable.
Now, what if I change the value of this student variable to something else?
Something like a number.
So let's change this value to ten.
OK, now what we did here is we changed the date to table this variable from string to a number.
And we can do this in Python code because Python is a dynamically typed language and in dynamically
typed languages, dated out of the variables or does not match.
Read the declaration.
OK, now let's talk about assigning values to the variables so you can assign multiple value values
to the multiple variables.
Let's see how well we have student student.
So basically these three years have same name, right.
Same variable, but they have different values.
Right.
So it will always we are already seeing that.
What an interpreter who is going to print the last a little word to me in good order to print it last.
They lose the last value, John, to do with that.
So now if I change this to the, say, two and three and now if I bring this to this, print it to do
it.
So here we go again.
OK, so these three are different variables and different values.
Right now, there is also another way to articulate this way, to assign these variables and acquis.
And just you can assign these variables to the values in just one level.
OK, so we can also assign these variables into just one line.
OK, this there is another way that I'm going to show you now.
Student.
One variable that is your first variable then student to the second variable, and there's two and three
now here you can see we had three variables separate to do.
The second one separated these three variables.
Now I'm able to assign similar values to these variables and the values are also separated into commas.
OK, so Jane and then John, so what we did here, we just this is another way to I to the variables.
OK, this you can assign multiple variables to the multiple values in one scenario to this.
And if I want to do this, well, again, I just have to bring this student to the the value of this,
Jane.
OK, so here you can see here it will be generally printed in the terminal.
So, again, if I want to get the value, let's do it.
You know, and if I want to get all these three values, then I would print all these three variables.
OK, so student one.
Student two.
And then I'm going to print this.
STUDENT three.
If they sell.
So I will get all this through, will you, Sam, John and John, so you can get a particular value
or all of these values quantize.