all right everybody we are moving on to variables a variable is a container for a value there's four different data types we'll discuss strings integers floats and booleans yes I know that's a silly name a variable behaves as if it was the value it contains each variable should have a unique name let's say we have a variable uh first name to assign a variable you use the assignment operator of equals for text a string is a series of text this can be double quotes or single quotes my own preference is double quotes why don't you type in your first name this variable a first name will behave as if it was this value the series of characters so to demonstrate this I'm going to print my first name variable so place it within a print statement without quotes that will print your first name now you don't want this within quotes because then you're literally printing the word first name you could use your variable along with some text by using what is called an F string that's the easiest way to display a variable so you type f then a set of quotes the f means format so let's say the word hello then we will add our variable we will insert our variable into this text when using an F string to do that you need a set of curly braces then insert your variable so the result is hello whatever your first name is in my case bro let's create another variable let's say we have a variable of food food equals think of your favorite food for me I will type Pizza let's print the following you like a placeholder again I'm using an FST string our variable of food hello bro you like pizza let's create an email use your own email or make up one let's say my email is bro1 123 fake. com then let's print our email your email is add a placeholder display our email variable your email is bro1 123 fake. com so these are strings I'm going to add a comment that these are strings a string is a series of characters they can include numbers but we treat them as characters now we have integers an integer is a whole number an example of this could be somebody's age how old old are they according to my YouTube statistics many of you are between the ages of 18 through 24 let's say that I'm 25 let me zoom in a little your integer should not be within quotes because it would be a string then technically if I would like to work with this variable again I'll use an F string let's say you are at a placeholder display our age variable years old you are 25 years old another example of an integer could be a quantity you are buying a certain amount of something maybe I am buying three items I wouldn't have half an item this would be a float technically rather than an integer we are buying three of something so let's print the following you are buying at a placeholder display our quantity items you are 25 years old you are buying three items another example of an integer could be an amount of people let's say num of students like a classroom there are 30 students in our class then we will print your class has at a placeholder students we will display the number of students num of students your class has 30 students those are integers they're whole numbers and again make sure they're not within quotes because then technically they would be a string integers we can use in arithmetic Expressions if they were strings we couldn't then we have floats float means floating Point number a float is a number but it contains a decimal portion an example would be a price what is the price of something $10.
99 let's print our price print I'll use an FST string the price is at a placeholder display our price the price is $10. 99 let's pre our placeholder with a unit of currency I'll pick American dollars but feel free to to pick something else the price is $10. 99 so floats contain a decimal portion what about a grade point average GPA let's say my GPA is 3.
2 then I will print your GPA is display our GPA your GPA is is 3. 2 what about a distance a distance can contain a decimal portion 5. 5 kilm maybe then I will print youan add a placeholder display our distance then I'll add km for kilomet or you could add Mi for miles but I'll stick with kilometers you ran 5.