From the course: Python Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Operators

Operators

- [Narrator] Operators perform operations on variables and values. Where variables are the data, operators are the instructions as to what to do with that data. The most obvious type of operator you're probably familiar with is the arithmetic operator. They do math. So we've seen the addition operator already. One plus one is two. Let's go over a few other arithmetic operators that Python makes available for us. This is the multiplication operator. It's an asterisk. It obviously multiplies numbers together, pretty straightforward. And this is the exponent. So this is five raised to the second power, which is 25. We can do division with a forward slash, so 20 divided by five is four. And notice that this returns a float value rather than an integer. Anytime you do division, you're going to get a float or a decimal value back. That's because you might not always get a whole number as the result of that division.…

Contents