Python Tutorials · Python Operators
Arithmetic Operators
Learn all about Arithmetic Operators in this comprehensive tutorial.
5 min read beginner
- •Arithmetic operators are used with numeric values to perform common mathematical operations:
- •Here is an example using different arithmetic operators:
- •Python has two division operators:
Arithmetic Operators
Arithmetic operators are used with numeric values to perform common mathematical operations:
| Operator | Name | Example | Try it |
|---|---|---|---|
| + | Addition | x + y | Try it » |
| - | Subtraction | x - y | Try it » |
| * | Multiplication | x * y | Try it » |
| / | Division | x / y | Try it » |
| % | Modulus | x % y | Try it » |
| ** | Exponentiation | x ** y | Try it » |
| // | Floor division | x // y | Try it » |
Examples
Here is an example using different arithmetic operators:
python
Division in Python
Python has two division operators:
- **/** - Division (returns a float)
- **//** - Floor division (returns an integer)
python
python
Module quiz
2 questions1
Which of the following is true about Arithmetic Operators?
2
What is the most common pitfall when working with Arithmetic Operators?
Answer all questions to submit.