Variable
Variable
about Variable.
So if you remember from school you had the subject which was called algebra and and the
subject we used
So if you recall from that class you might know that x y ABC and all the other things were
actually
called as variable
So essentially a variable is nothing but something which allows us to store a certain value.
So in the previous lectures we learnt about a lot of things but variables are actually one of
the most
Not only in Python because every program is nothing but something which actually takes
the data processes
it and finally puts out a result by manipulating that data are those numbers.
or store the data and variables are the things which allows us to do exactly the same thing
which is
So without wasting any time let's go ahead and learn what are variables so let's make a
simple variable
So what you need to do is that you need to use that equal to sign this equal to sign and
Python as known
So we type a equal ten and when we do that the value of 10 is going to get stored in a.
And if you don't believe me then let's go ahead and print out the value of the variable.
Now let's take another variable b and let's assign a value of 20 to it.
So again if you want to check if the value is actually stored you could simply print out the
content
of B.
Now what you could do is that you could have a 3rd variable c
And you would simply say that c equal to a plus b so what this is going to do is that it is
going to take
is going to be 30.
So if you want to check it by yourself you could simply type and print and you could pass in
a value
of c to print.
And if we actually print out the value as you could see you have the value of 30 within c.
And also one more thing which I would like to mention about variable is that you can not
only store numbers
into variables but you will also store names.
So you could simply type a equals and you type in your name here so I'm going to type in
my name and
if you hit enter the name actually gets stored in the variable.
But the only thing which you need to remember is that when you actually want to store a
value of name
to a particular variable or if you want to store a string into a variable you always mention
the string
So in this case I mentioned my name and course and word this thing does is that tells
Python that we
So if you again print out the value of it as you could see I'm going to get my name and
you're going
to get yours because you actually store your name into the variable.
So in that case what you could do is that you could go ahead and delete it by using the
delete statement.
So you could simply type in the del space and then specify from which particular variable
you want to delete
the data.
So simply Daubeny and hit enter and the data which was stored in the video will now be
completely removed.
So if you want to make sure that the data is removed you could type and print and now this
time if you
pass the value of the variable as you could see it sees that name is not defined.
could be the numbers or strings or sentences so you could actually stored sentences and
variables as
And in the next lecture you are going to learn something about the emplace operators.
So thank you very much for watching and I'll see you guys next time.
Thank you.