 Hello, everybody. Today, we're going to be talking about converting data types in Python. In this video, I'm going to show you how to convert several different data types, including strings, numbers, sets, tuples, and even dictionaries. So let's start off by creating a variable. We'll say num underscore int is equal to seven. And we can check that data type by saying type and then inserting our variable number underscore int. And that will tell us that our data type for this variable is an integer. Let's go ahead and create another one. We're going to say num underscore string is equal to and for this one, we'll also do a seven, but let's check the type and we'll do an open parentheses. And we'll say the type of num string and that one is a string. Now, let's say we wanted to add those. We'll say num underscore sum. So the sum of num underscore int plus num underscore string. Now, when we're adding these two values, it is not going to work. It's going to give us an error and it's going to say unsupported operand for int and string. So it cannot add both an integer and a string. What we need to do in order to add these two numbers is to convert that string into an integer. So let's go right up here. Let's add another cell and let's say num underscore string underscore converted is equal to and we want to convert it into an integer. So all we have to do to convert it into an integer is type int and then we're going to say num underscore string. And that is as easy as it's going to get. All we have to do is say integer with our num string inside of it. And then it's going to convert it and we can even check it right after by saying type num string converted and let's run this. And now we can see that it was converted into an integer. So now let's add that num string converted right here. Let's copy and replace that string with the string converted. And let's actually print out that num underscore some and it worked properly. Now we did not specify what type of value this num some was going to be. But because it was two integers in here, it's going to automatically apply that data type of integer to that num some. Let's go right down here. And now let's look at how we can convert lists, sets and tuples. So now let's say we have a list underscore type and that's equal to one, two, three. And we can check it again by saying type and that is a list. Let's say we want to convert it to a tuple. It's fairly easy. All we're going to do is write tuple, say list underscore type. Now list underscore type is now going to be a tuple. And we can check that by saying type and wrapping it around this tuple. And it shows us that it is converting that list into a tuple. Now we can also convert a list into a set, but it may change the actual values within it. And let's check that out really quickly. So let's say we have this list and let's add a few more values to this just like that. Now let's say we want to convert it to a set. So we're going to run this and we'll say set of list underscore type. And let's try running this and see what the output is. So this is something that you really need to be aware of when you are converting data types because set does not act the same as a list. A set is basically going to take the unique values in the list and convert it to a set. And it fundamentally changes the data that was in that original list. And just to check the data type, we can say type. I'm just doing this for all of them. And as you can see, that is now a set. Now let's go down here and take a look at dictionaries. Now let's say we have a dictionary called dictionary underscore type. And we'll do a squiggly bracket and we'll say name and we'll do a colon and we'll say Alex. Then we'll do age and a colon and we'll say 28. And then we'll do here. All in and so really quickly, let's take that dictionary type and just confirm that it is a dictionary. And it is. And now what we're going to do is take a look at all of the items within that dictionary. So we're going to do dictionary type.items open parentheses. And this is going to show us all the items within it. Now we can also take this and look at something like the values. And when we run that, these are our values. So within our dictionary, we have items and that's what this is right here. This is one item. And then within that, we have our values, which are right here. So Alex, 28 and NA. And then we have something called a key. And this is the key, the name, age and hair are all keys. And we can look at that by saying dot ease. So let's say we want to take all of the keys and put that into a list. What we're going to do is we're going to take this right here, say list. We'll do an open parentheses. We'll type that in right there. So it says a list and we're converting these keys into a list and let's run that. And now this is a list. And let's just check the type as well, just to confirm. And as you can see, it was converted properly into a list. And we can do the exact same thing with values. And the values can also be converted into a list. Now, we can also convert longer strings that aren't just numbers like we did above in our very first example. So let's do long underscore string and we'll say I like to party. Now we're going to take this string and we're going to say list long string. So we're going to convert this string into a list and let's see what happens. So it took every single character in that string and put it into a list. And we could also do a set as well. That one's a lot shorter because it's only looking at unique values. So that is how you convert data types in Python. Thank you guys so much for watching. I really appreciate it. If you liked this video, be sure to like and subscribe below. And I'll see you in the next video.