Welcome back.
This is a quick optional video that well, with something that you probably won't use, but I want you
to just know that it's out there.
And that is there's actually an extra data type that I didn't talk about, and it's called complex.
And as the name suggests, it's pretty complex.
However, a complex number, again, is a number that is a third type instead of int and float.
We also have this type for numbers.
Now the reason I'm not really teaching complex is that you only use this if you're doing something really,
really complex math.
Most of the time you'll never use it.
I personally have never used it, but it is good to know that it exists.
It's the equivalent to a real number and you can read about complex numbers if you want.
But again, that's something that you don't need to worry.
99.9% of the time.
Another thing I want to talk to you about is this idea that these integers and floats get stored, such
as five in memory as binary, that is as binary numbers, ones and zeros.
And there's actually an action or function that we can use in Python called bin for binary.
And you can see that a bin returns the binary representation of an integer.
So it's going to return whatever the binary version of five is.
If I click run here.
Well, I have to print, remember?
So let's print.
And Click Run.
And I get the binary representation now instead of all zeros and ones.
There's also this idea of B, and that is what Python uses underneath the hood to say A when I see this
number with zero B, that's a binary number.
But if I Google binary number five.
I see that the binary number for five is 101, which again, that's what we see here.
So that's really cool.
Really interesting.
Just to know that it exists, by the way, just for fun, let's say that we want to turn this into a
decimal.
Let's say we're the computer and we just retrieve this binary number.
I can do it and then wrap this.
Like this in single or double quotes.
And then with the inte, i can also say, hey, I want this return to a number that is base ten, which
is what us humans use.
So if I actually do print here.
And Click Run.
Well, actually, we have to do base two here, right.
Because what we're saying is, hey, this number is base two and convert it to integer and base two.
Number is all zeros and one.
It's a binary number.
So if I click run here.
Look at that.
I get five.
So in your head you can think of it this way.
When we store a number like five, an integer like five, when a computer retrieves that number, let's
say we're doing some addition.
Well, it's going to grab this for memory.
It's going to say, well, this is a binary number and I'm going to convert it into integer.
Very, very cool.
Now, the reason I taught this here, you won't see this a lot in beginner courses and especially so
early in the course, but I think it's an important principle, although you might not get tested on
this ever.
For you to just understand how things are working underneath the hood, I believe, is an important
thing for you to do in order to become a great developer.
So hopefully this doesn't confuse you too much.
I'll see you in the next video.
Bye bye.