Instructor: Welcome back.
Let's continue our understanding of int and float.
We talked about the idea of these two data types
and how we can use operations on them
that we're familiar with from math class.
Plus a few ones that, maybe, we haven't seen before,
such as modular or the double slash,
or the double multiply for the power of.
Now, this is really cool because
we can get our computers to do,
well, math for us like a calculator, right?
But a programming language also provides for us
different actions that we can perform.
Now, besides these ones,
we also learn that there's a type action that we can take.
There's a print action that we can take,
but there's also specific math type functions
that in and float are able to use,
that are built into Python.
Now, these are called, well, math functions.
And functions, something we'll talk about later on,
are these actions that we've been talking about.
Remember our diagram here?
We're starting to learn about the data types
and the actions that we can perform on them.
Now, in most programming languages,
these actions are called functions,
and we have a whole section on them.
But for now, there's some functions that we can use.
So this is a print function.
This is a type function.
But there's specific math functions,
such as round.
And you see right away, when I type,
Repl is a tool, like an ID,
that hints and tells us what we can add.
So it says, "Round,"
and, "give me a number,"
and, maybe, "a digit."
But let's just worry about the first one for now.
So round, if I do 3.1,
and I round here,
I get two.
Hmm. Well, that's not right, right?
That's actually the result from up here
because we need to also tell it
to perform with a function of print.
"Hey, print to the screen
whatever the result of this is."
And just to make things easier to see,
I'm going to comment this out.
So I'm just selecting everything,
and then pressing Command + /,
or if you're on Windows, Control + /.
If I click Run, I get three because
I'm rounding down the number.
So let's say if it was 3.9,
I click,
and I get four.
Again, I'm rounding the number.
Another math function that's built into Python is
something called abs.
And you see, right away, that I get abs here,
and ABS returns the absolute value of the argument.
And again, for those that aren't too familiar with math,
an absolute value simply means,
well, no negative numbers.
So an absolute value of negative 20 is 20.
And now, because we know about math functions,
I can start Googling, right?
I can say, "Hey, I'm a Python programmer,
and I wanna learn about math functions."
Well, I can go, Python 3 math functions,
and look at that.
Right away, Google tells me that
there's a ton that we can use.
You don't have to memorize all of these.
As a matter of fact,
some of these I've never ever used in my programming career.
But it's good to know
that they have these tools available to you.
And as a programmer,
this is something that you'll have to get used to.
The idea that you won't actually memorize
every single action that we can take for each data type
because some of these are very rarely used.
Some of them you'll never use in your career.
The key is to understand how to Google them
and how to find them.
And throughout this course,
I will show you the important ones
that you're gonna see over and over and over.
But as a way for you to develop as a programmer,
at least you know that this is
how you look for answers and find out that,
hey, there's different math functions
that we can use with numbers.
Right, let's take a break
and continue in the next video.
Bye-bye.