All right. Let's take a look at some basic arithmetic.
Now, when I say basic arithmetic, all I mean here is math,
and I don't mean advanced math.
It's not algebra, it's not calculus,
it's nothing complicated.
But we do need to know how we can add subtract, divide, multiply,
and we'll probably even use exponents, oops, and give you a
sneak peek there, exponents.
So in Python, and in most programming languages,
these rules hold true.
So when you're trying to add a number you can add, let's
say 89 + 11.
And that's just simply going to add the number. That will give us 100.
And likewise, if we wanted to subtract a number, it's the
subtract symbol, so 100 - 49 is equal to 51.
Dividing is as simple as 100,
and then you use a '/', divided by, let's divide that by
10. That will give us 10.
And if we want to multiply, we could do 9 times 9,
and to multiply it's just an '*'.
So it's the little '*' symbol.
And that's how we multiply.
And exponents are one we're going to be using throughout
to this course quite frequently.
And in exponents in some programming languages is like three
to the power of three, 3^3,
but in Python we use two asterisks side by side, '**'
So three to the power of three, 3**3 is going to give us 27, 3
times 3 times 3; 3 times 3 times 3 is what that is.
And that is how we do an exponent.
Now, there's one other thing that we're going to look at
a little bit down the road, and it's called modulus, modulus.
And you know, when you divide a number, and you get a remainder,
that's what a modulus is.
So if you divide 10 by 3, you're going to get 3 with
some remainder.
So 3.333.
Now what if you wanted to get that remainder as a number?
So 3 goes into 10, 3 times 3-6-9, and there's a remainder of 1.
We can do that with the percent(%) symbol.
So we take one number and we divide it by, not divided by,
we modulus it by a second number, and we hit enter, and we get 1.
So what that means is 3 goes into 10, 3 times 3-6-9,
and then 10 minus 9 is going to be 1, and that's your
remainder. Beyond that, we're actually not going to be doing
too much arithmetic in this course.
And believe it or not, there's actually not a lot of mathematics
in most programming these days.
There is mathematics
if you get into data science, or if you want to get into, even
some forms of machine learning has some math,
but for the most part programming does not have a lot of
math, and so by no means do you need to be a mathematician
in order to learn how to program.
People always think that, "Oh, because you're a programmer,
you must be good at math".
But that simply does not have to be true.
So that is basic arithmetic.
We add with a '+' symbol, we subtract with the '-' or the minus symbol,
we divide with a '/',
we multiply with an asterisk or the star, '*',
we exponent with two stars, '**',
and this is just multiplying three numbers together, and
we modulus or get the remainder with a percent (%) symbol.