From the course: Certified Entry-Level Python Programmer (PCEP-30-02) Cert Prep

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Using operators

Using operators

- [Instructor] Now it's time to talk about operators. There are different kind of operators in Python. We have the typically well known arithmetic operators, so the addition, subtraction, multiplication, division. But then we have also a couple that may be new to some of you. For example, the modulus or modular or also known as remainder, that will actually take the remainder of a division. We use double asterisk for exponentiation. Exponentiation is, for example, when you're raising two to the power of three. And we have floor division, and what is that? Floor division is double forward slash. It's going to be a division that will return always an integer. So if the division gives you a float number, so a decimal number, it's taking only the integer part of it. This is also known as integer division on other languages. When you're using these operators, if the two operands are integers, the operator returns an…

Contents