So let's start with Python variable. Now what is a Python variable packet variable is a reserved memory location to store values. So variables are nothing but reserved memory location to store values. This means that when you create a variable you reserve some space in memory variables are containers for storing data values. No Python variables do not need explicit declaration to reserve memory space. The declaration happens automatically when you assign a value to the variable.
The equal sign is used to assign values to a variable, a variable is created the moment you assign a value to it. So here, for example, have created a variable called x where I've assigned a value five. Now this is a numerical value and if I want to assign value or character value then have written Why go to Michael. Michael is a value that is assigned in y. So creating variable. Now a variable can have a short name life as I told you x and y, or you can also provide a more restrictive name such as each car name to some volume, but there are some rules to assign a variable name in Python.
So a variable name must start with a letter or underscore character. A variable name cannot start with a number. A variable name can only contain alphanumerical character and underscore like A to Zed zero to nine and an underscore. So variable names are case sensitive. So age, with all lowercase and age with a capital and age with all uppercase are three different variables. So always remember The the variables are case sensitive in Python.
So let us create some variables in Python so that you will understand how we use or how we create variables in Python. OK, so I have already told you how to install Anaconda navigator and now after installation from your start menu, just click it over here and open your Anaconda navigator from here I have already opened it but still and show you this Anaconda navigator. So it will be over here to search it from here and you will get it over here. So just click it over here and it will open up and this will be your homepage for Anaconda navigator now we'll be working on Jupiter. So in this Jupiter notebook we'll be working on so just launch it, launch it from here and it will open a page like this in your browser. So whenever you You will see this page right from here new click it and see there is no book called Python three and now open this Python three whenever you click on Python three, a new tab will open up like this.
So this is your Jupiter notebook. Now before starting, I think any program or anything or printing any variable, I will suggest you to rename your current notebook. So this is where you rename it. See, it will always be untitled in this way until it 100 200 to 304 any number of untainted can be here. So just click it over here. See, so here I will just rename this to say first class.
So this is our first class in Python. So I've just named it as first class. So just press rename and it will be renamed See, now this is where I will type my program or I could type in code. So first let me show you how to print the particular thing or particular string or particular variable in your Python. So here I will write print then after train, see print is a function. And always remember that after writing any function name, there will be a bracket.
So, just give a bracket over here. And here I will train okay to string so I'll give up double quotes. So now you can use a single quotation also, but I prefer to use a double quotes so double quotes then here I am right. Hello, on Eva comma, right. Welcome to our fight can go Okay, now how to run this program, place your cursor anywhere, anywhere in these right on this code and just press Shift Enter and it will run see you got your result over here so what it says so I've just written print hello all welcome to our Python class. So it is printed the whole text here.
Hello all welcome to our Python class. So in this way, you can use the print function of print. The first statement we have print our first statement in Python. Now let us create a variable. Now suppose I have to create a variable called a and let me create first a numerical variable. So I'm just write a equal to 10.
And without running it, just press enter. It will come to the next line. Now here I can write b is equal to find now should I write print a And again in the next line, print B. Now run this program, now placing your cursor and just press Shift Enter. So what it print, it prints the value of a and the value of b. So whatever value you assign to your variable, it will be printed if you just submit a code or submit a function called print and write your variable name over there.
Now let me create another variable say and create name no name is equal to here I have to write within the codes because here I'll be writing characters or strings. So whenever you write strings, you must write it within the codes. So name, and then here I write. Smith. Now if I want to write one more name I'm writing anymore is equal to in I'm right here, john. Now, I write brings me in the next nine, print name one.
So just press Shift, enter, and it will print the values of me and name one, which is Smith on, john. Let me show you something more. So here I've already assigned the value of a and b two, five and 10. Now, if I want to perform an operation on this particular A and B variable, then what I have to do so a and b is already stored as 10 and five. Now here I want to write C is equal to a plus b. And now print See, let's see what happened.
See, it gives the reason 15 because the value of a and b is already stored as 10 and 15. Now here, I want to perform my arithmetic operation. That is, I want to store the value of A plus B in C. So I've stored it, and now I'm printing the value of C. So I got 15. So in this way, this is a very minor example I've shown you so in this way, we can just assign a variable, create a variable, and use those particular variables to print the result or print the value. Now just tell me what happens if I use this plus sign or this addition sign in character value or in in string value, what will happen so I created a variable over your knee anymore. Now I'm sure you If I print all it suppose I will create one more variable called name two, and here I was two so I'm right name last name one and then I'm print name two.
So let's see what happened. See what it printed it printed Smith john. So it just concatenate the two characters or the two string together printed sweet john together. So, whenever you will use the addition sign or the plus sign in the string, string variable or any character variable, it will just concatenate the two variables together. So today we have learned how to create variables, how to use those variables, how to use the print function. So I'll be ending my videos over here and see you in the next video.
Thank you