Hello, in this video we are going to cover assignment operators. So what I'm going to do is create a variable called opponent vol one and I'm gonna do this a VAR one equals two equals equal to the mathematical operator operation my sickle cell. Yeah, why not? What is it for seven equals 13? Okay, so that's, you know, one form of assignment operator, which we weren't done when we looked at variables. We didn't quite cover it explicitly, but you know, that we did we have used it.
Another assignment operator is one where you basically compound a math mat, an arithmetic operator along with the assignment. So let me show you something. So if we have one, so it's 31 at the moment, so for the var to fall one, what we can do we can say for one to add five to our one, he will be VA one plus five. So we get vol one as 13. Then vol one equals itself plus five, which is at 30 printed out or printed at two different locations for print, four. And if we run this, let's see what we get.
Okay, so 13 and 18, as we predicted, that'd be a shorthand way of doing this. So you can do var one, and you can put plus equals five. So what this is saying is var one equals its self. plus five. That's, you know, that is the, this right here is the equivalent of what we just wrote. A lot simpler.
Nicki Quint, Watch this one just to make sure so we should get 23 in this particular line now. Yeah, so 13, we had five, then we use the assignment operator, which helps compound it. And 23. I know what's going through your head, you might be thinking, we've added a plus here, could we do the same with minus with times. And yet, you can do that the same literally all of the arithmetic operators down to the modular at the X ponent, operator, and even the floor division operator. So as an extra task, I want you to go through all the the arithmetic video again, if you haven't already done so have a look at all the operators and change it into this sort of format.
So you're modifying the variable, but without having to do this longhand way. So that's it for assignment operator. Thanks for watching, and I look forward to seeing you in the next video.