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 modulo 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 learned 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 enter 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 around and you see right away when
I type Ripple is a tool like an idea that hints and tells us what we can add so says round and give
me a number and maybe an digit.
But let's just worry about the first one for now.
So around if I do three point one and I round here
two.
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 slash or if you're on Windows control slash
if I click Run I get three because I'm rounding down the number so let's say it was three point nine
I click and I get four again I'm rounding the number another math function that's built into python
is something called a B S and you see right away that I get a B.S. here and a B.S. 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 want to learn about math functions well I can go Python
3 math functions and look at that right away.
Google tells me that there is 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 how to find them.
And throughout this course I will show you the important ones that you're going to 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.
All right.
Let's take a break and continue in the next video by.