Welcome back.
Remember in Python, that string is written as a star and this is a special word, actually, it's a
built in what we call function or built in action that we can take.
Now, let me ask you this.
What happens if I do string?
One hundred is clearly a number, an integer.
But what if we run the string function on this?
Let's find out.
Let's do.
Print here.
And then run this if I click, run.
I get a hundred, all right, but hmm, is this an int or a string?
To find that out once again, let's wrap this up, so the answer of whatever this value is into type.
I know this is a lot of brackets, but remember, we're evaluating this piece of code, so we're turning
a hundred into a string or running the string action, and then we're going to check the type of this
entire thing and then we're going to print it out.
If I click, run.
I see that it's a string type, so we've converted one hundred into string using this now just to confuse
you a little bit more.
What if we do something like.
All right, even more brackets, what happens now?
Can you guess?
Well, we convert a hundred into a string, then convert it back into an integer, and then we check
the type of it, which is a class int and then we print that.
So remember, this was the same as me saying A equals a star one hundred and then B is going to equal
int.
Of a because we're evaluating this part and then I'm saying C is going to equal the type of whatever
B is, and then finally we're printing C.
So that piece of code was the same as doing this.
Very, very cool.
Now, this is the idea of type conversion.
Again, if I were to write that down, it's called type conversion, we're converting the type of our
data types and you can do that throughout programming and we'll talk a lot about this throughout the
course.
But it's the main reason we have things like SDR int.
We have things like float and many other data types that we're going to talk about.
I'll see in the next video by.