What are mathematical operators in Python?
23May, 2022
How Can We Help?
Created On
byMatt
Print
You are here:
< Back
Maker of websites,
Teacher,
Cat enthusiast
Teacher,
Cat enthusiast
Latest posts by Matt (see all)
- The 2022 End of Year Website Update - 01/01/2023
- Celebrating Ada Lovelace day - 10/10/2022
- Website update 5/9/22 - 05/09/2022
In programming, there is often a need to perform calculations, and one of the reasons that computers were created is to perform complex calculations automatically for us so we don’t have to!
Due to this, Python can perform numerous calculations using various mathematical operators.
Python mathematical operator | Description | Example | Result |
+ | Add | print(7 + 3) | 10 |
– | Subtract / minus | print(16 – 8) | 8 |
* | Multiply | print(5 * 10) | 50 |
/ | Divide | print(36 / 6) | 6 |
% | Modulus | print (28 % 9) | 1 |
** | Exponentiation | print(2 ** 3) | 8 |
// | Floor division | print (19 // 2) | 9 |
Matt
administrator
Maker of websites,
Teacher,
Cat enthusiast