[MUSIC] Welcome back everyone. In this video we're going to talk about variables which is a foundational principle in programming. So go ahead and open up Xcode and you can create a new playground or use the existing playground that you already have. I'm going to click get started with a playground. I'm going to click Blank, say Next. I'm going to put this on my desktop and call this variables. And I'll maximize the screen here. I'll go ahead and delete this first variable that's already been created for us. And what is a variable? Well, a variable is kind of like an alias or a bucket that you put a label on, you can put things in it and reassign things to it. And so what does that mean? Well, let's use a real practical example. Let's talk about a person, lots of applications, web apps, iPhone apps, that have to do with people. And so what are some attributes about a person? Well, a name one, so we could say var name = "Bob", okay? An age, var age = 51. var weight = 212.15, that would be pounds. I don't know what that be in kilograms, but 15 ounces, whatever. And var isOrganDonor, we'll say false. So here's some things about a person and people are different, right? So Bob's name belongs to Bob but if this application was being used by different person, this might be Jennifer or Steve, okay? So there's some things that can change on our variables here and that's pretty cool. And we've got some different types of data as well, too. For instance, this is a string. This is an integer. Weight is a double. And isOrganDonor is something called a Boolean, true or false. And when you have data in these variables, you can do things with them. So now we can print the weight. And you can click this run button here and it'll show it over here on the right-hand side 212.15. So we can print it, we can do things with it, pretty cool. So variables are mutable, meaning they can change. So let's say that Bob decided to work out and he lost some weight. So we say weight = 200 pounds and 10 ounces, okay? And now we can print the weight again. And look at that, below here he is now 200 pounds or so because we've changed the variable. So that's pretty cool, variables are mutable, they can change, okay? And what's also really important to note is when you create a variable, it's storing this on the memory of your computer, typically on your RAM. So when you hear somebody say, I need to upgrade my computer and get more RAM. Well, what you're really saying is, I want more space for variables to be stored in applications. So the more RAM you have, the faster they can go typically because they don't have to wait for other data to be pushed through because there's more space for your application to use. So we've got some variables here. Now, what if we want things that are unchanging? Well, that would be something called a constant. And you define a constant using the let keyword. So variable uses the var keyword, a constant unchanging uses let. We're going to say eyeColor = "Blue". And we're going to use that string value again. You know it's a string when it's inside of the double quotes. Okay, so eyeColor = "Blue". Well, what happens if I say eyeColor = "Green", and try and run it? You notice we're going to get an error down here, cannot assign value to "eyeColor" is a "let" constant. So again, it's unchanging and we know someone's eyes typically aren't going to change. So in your application you want to specify which properties are variables or mutable and which properties are constant or unchanging or immutable. So variables are going to form the foundation of all of your applications. You're going to be working with data that you can manipulate and use. I want you to think about any application you've ever used whether it's a form on a website or an iPhone app somewhere in that application. They are storing that data. When you type in your name or password data is being stored, it's being manipulated, being changed and doing all kinds of things are happening the data. And that's what you're doing right here. So what we've learned in this lesson is how to work with variables which are changeable or mutable. We've learned to work with constants which are unchanging. And then you learned briefly about some of these different data types such as strings and integers which we haven't really talked about yet, but we're just scratching the surface here. So we're going to call this video done and go ahead and do the exercise and move on to the next video.