Articles → Python → Mathematical Operator In Python
Mathematical Operator In Python
- Add operator (+)→ This operator is used to add 2 numbers.
- Subtract operator (-)→ This operator is used to subtract one number from other.
- Multiply operator (*)→ This operator is used to multiply 2 numbers.
- Divide operator (/)→ This operator is used to divide 2 numbers.
- Modulus operator (%)→ This operator returns the reminder when one number is divided by other. For example, if 10 is divided by 3 then 1 will be the reminder.
- Exponent operator (**)→ This operator is used to perform exponential calculation on operand. For example, 32 is written as 3 **2 in python which is calculated as 2 times 3 i.e. 3 * 3 which is equal to 9.
- Floor division (//)→ This operator will provide the result of division 2 numbers after removing decimal. For example, if we divide 11 by 3 then result of division would be 3.66. After removing the decimal, the result would be 3.
Click to Enlarge