 Hey, what's going on guys root at no shell.com here today, and we are looking at some more Python Today we're gonna check out some variables variables are kind of like the crucial the most the most important backbone of Programming and computer science because they act as placeholders. They are abstract. They represent a different data type And let me get started. Let's show you let's show you guys what's up So I'll get idle going and we'll drag it over here so you guys can see it and let's get started So now when you are working with the variable when you're trying to initialize the variable as a terminology that I want to be Using today when you're initializing the variable what you do is first in a different language other than Python you would normally Declare the variable they call it declaring because you're just simply stating I'm going to use this variable you allocate or you make room for that variable in your computer's memory and In like a language like like C++ or something or C You would just type in a int and the name of the variable like number now in Python You don't have to do that. They have Python has what they call Dynamic typesetting because you can set a variable without having to have to specifically declare Okay, this is what the number this is what the variable means You know obviously the variable has a specific data type whether it's a string whether it's an integer whether it's a float Whether it's a boolean that sort of thing, but it doesn't have to be like static It's it can change and you don't have to declare it that way one way all the time. So But that's that's kind of all I wanted to get across to you in this was what declaring is the terminology for just saying the variable name like let's call it number and So when you have your variable when you've declared it what you don't have to do in Python So you don't have to worry about that you can what you do is you define it? Defining it is giving it a value or giving it something that it represents of the actual value of that variable You're gonna hear the words value tossed around a lot because that corresponds with the variable What is the value? What does the variable actually mean? What is its value? You know, so that makes sense So number if we have something called a number, maybe number can represent. Let's say four There you go now. It's number is set. It's stored in memory So if we type in number we will get four because that's what it equals That's what it represents now. We have declared and defined number to equal four So that's interesting though. We can we can set up like floats Actually, we'll name it something else. So it's not a it's not a keyword. We'll call it double equals 3.14 Actually, we'll do like 45.67 we've got double If I can type it correctly we got double we can set pi to three point one four And now we have now we got pi three point one four. Awesome. We can print these things out if we need to Three point one four and boom actually. Whoops. I should you've used the variable there That's let's pay attention to what I'm doing here people Yep printing out pi gets you that same thing as three point one four because that's what it equals to we've set it To be that now if we work with that a little bit more though We can set maybe we can set a name. Let's say let's use a string variable. Let's use John Just use my name name is John. We can just use name is John. We print that out name Now you can just get John. That's that's easy enough, right? This represents something else now You can have underscores letters and that sort of thing all in the variable the name of the variable But you can't have it start with the number if we had like one inch equals two It freaks out if we had in two inch one equals two It'll understand that and we'll have in one but anything with a number in front of it It's it's not gonna it's not gonna accept that that Yeah, the program Python the language will just be like nope shut down rejected and you'll get an error But anyway, what I want to talk about now though are assignment operators assignment operators are those Operators or those symbols that you're using to actually define the variable and we've been using an assignment operator this entire time We're using equals. We were using number equals four. We're setting. We're assigning the value four to number Does that make sense? So now we can manipulate that though we can set things relative to what they already are since number equals four We can use number Plus equals and we can add to it We can add we can use we're gonna use that assignment operator plus equals to add to number and let's add to how about that? So now when we check out number again, it's six because we've got four and then we add six to it I'm sorry four and add two to it and now we have number which is six Perfect that makes sense right? Let's try with name. We can do name plus equals Hammond Name John Hammond awesome note the space there That's what I'm using to differentiate the two names John is the first name And we've added him and on there with that space so you can tell that it's two different names It's actually one name obviously, but you understand what I'm saying if you're using subtraction though It that works the same way you can use number subtract equals three Number is now three you can use number times equals to four Number now equals 12 you can use number divided equals to Number equals what number equals six there you go now. This is interesting though But because we're setting it as it's because the variable is treated as a data type if we use number divided by two It's going to take the value of number Six and then divide that by two so you'll get three But when we check out number number is still six because we haven't assigned that value to it. We're just we're just manipulating it Number when we have that equal sign there. It's setting it relative to what it is But when we're just playing with the data dividing it by two without setting it or anything there it is Does that make sense to you guys? Want to make sure you guys understand this now because I want to move into something else because some people some programmers It's this is sort of a style or a technique that some people like to adopt I myself don't use it too often But they'll use a naming convention when they declare variables So they'll have a better understanding of what it really means because the whole point of using a variable is that it Varies you never exactly know what the what it might be and this night This might seem kind of useless at first because if you wanted to do like a number times two You already know that number is equal to six why didn't you just do six times two in the first place? That's dumb the thing is if we had a user input information like if they're trying to If they're using this program for a more general sense if we're trying to build something for them that they can manipulate on their Own they're gonna have to be able to put in their own data So we don't know exactly what they're gonna send in but we still have to be able to process that and that's all variables do they allow The programmer access to what the user needs to get done by this sort of like fourth wall, and I don't want to say it's the fourth wall, but Yeah, that I think I'm I think I'm rambling about this more than I have to the variables vary for that reason Because you never know what it might be and that's why Sometimes they use a naming convention if they know the type that it has to be if we had an int underscore number Let's say that's 30 int underscore number is 30, but Now now that we have that int underscore We know that it's going to be an integer because we've declared it that way if we're processing it in our in our program Let's say we're just adding things to it in number Plus equals four or something do it again do it again do it again do it again do again if we did int number Plus equals string That wouldn't make any sense because We as a programmer already know that it's an integer So we would never do that because we've given ourselves a little notification that okay, this is an integer variable We should manipulate it the way you would normally manipulate an integer not a string. It's almost like a little Oh, it's almost like a seatbelt for the programmer Just so they don't don't they don't do anything stupid because they know okay This is the kind of data that I'm working with I'm going to keep it that way So you can do that with string obviously since you're naming the variable you can name it whatever you want it You can have it be string Billy Bob Jones. I I don't even care Billy Bob Jones equals fish and Now we know that it's a string variable because we've got that there. Oh Close and a unity. I don't know why I hit that there you go string Billy Bob Jones equal to fish good enough But that's really all I want to show you guys today I want you to be able to know the terms declaring defining value Assignment operators. I want you to have a little bit of an understanding what these assignment operators do what they can do for your for your variables for the data that you're manipulating and Yeah, that's that's all I mean once you get those down You should be able to have a greater understanding and you should be able to be able to work with things on the fly You'll be able to just pop out. Okay. I need this to equal that and I'm going to have to add things to it relative to what it already is and You have to have that abstract sort of mindset to be able to manipulate the data that you might have to process later on so That's all I'm gonna bow. I'm gonna bow right now. I Don't know. Thank you guys. Thank you for watching. Thank you for listening. It'd be awesome if you could give me a like Maybe a maybe subscribe. I don't know. I don't know. I'm just gonna just gonna toss that out there I'm gonna give you an idea here. You can you can take it or leave it Thanks again guys. I'll see you in the next tutorial. Bye