Operators in Python
The Operators which are used in Python to perform a specific operation. From my opinion I love to work with Python operators and libraries, as they are very simple and easy to understand.
What are operators?
An operator is a symbol that represents an operation to be performed on an operands.
This operator ('+') represents add operation to be performed on 30 and 5 to give 35 as a result
Basic operators in programming
Arithmetic operators in Python
These are all the common mathematical operators.
Operator | Operation |
---|---|
+ | Addition |
- | Subtraction |
* | Multiplication |
/ | Division |
% | Modulus |
** | Exponentiation |
// | Floor division |
Addition operator
Perform addition of two numbers.
Subtraction operator
Perform Subtraction of two numbers.
Multiplication operator
Multiply two numbers given to it.
Division operator
Divides the numbers given to it.
Modulus operator
Gives the remainder of division operation.
Exponentiation operator
Raising a number to the power of another number. double asterisks are used to denote exponentiation operation in Python.
Floor division
Rounds of the result got from division operation, down to the nearest whole number.
إرسال تعليق
If you have any query, feel free to ask.