Instructor: Welcome back.
I wanna quickly talk
about something called augmented assignment operator.
So, we've learned that we can create variables
like some_value and we can assign it a data type.
In our case, let's just assign it five.
There's something called augmented assignment operator
that allows us to do something quite neat.
Let's have a look.
So, if this value, I wanna increase it,
let's say, five plus two.
So, add two to it.
I could do that,
or I could even use some_value
which is already five by the time it gets to line three
and do something like this.
If I print some_value,
and I click run, I'll get seven,
because five plus two equals to seven.
So, in memory, some value points to seven.
But there's a neater way of doing this,
called augmented assignment operator.
Instead of doing something like this,
I could just simply,
add a plus to the equals.
So, we're going to say some_value
plus equals two is still going to equal seven.
So it's the same thing as before
and this is called augmented assignment operator.
It's a shorthand of us doing something like this.
We can also change this to something like minus
which once again is like subtracting two
from whatever the previous value of some_value was.
Now, if I was to do this at the beginning here
so let's just do here and then comment this out
and if I click run, I'll get an error
because some_value is not defined.
We haven't really created anything.
So, in order for this to work, we need to make sure
that this variable has some previous value.
So, we've learned about the plus, the minus,
and then finally we have the multiply.
Once again, if I run this, we get 10.
Remember, this is just the same
as us saying some_value times two.
It's just a shorthand form.
All right, this was a quick video.
In case you see something like this in the wild.
Now, you shouldn't be afraid.
Remember that the operator comes
to the left of the equals sign.
I'll see you in the next one.
Bye bye.