Wonders, what does mean in Python Programming.
An operator is a symbol or function which performs a specific function and yields results.
Every programming language has a certain defined set of predefined symbols that have a specific meaning attached to it and those symbols are generally neither alphabetical characters nor numeric characters or digits. Though some special characters are present which are may be used as words on a daily basis by us but they have a certain meaning when it comes into programming.
What Does Mean in Python?
Now these symbols or special functions operate over a specific predefined.
For example, the ‘equal to’ symbol (=), is predefined in python and most of the languages used as an assignment operator. So in its case the name of the operator is on the left side of the equal to sign and whatever expression that is on the right side will be assigned to it.
so, ‘=’ this sign is associated with assigning the value and there are many more which are really common and are used on a regular basis for some of the other reasons.
Now, in python there are a variety of operators that perform different functions. The basic operators provided in python through which python is actually operated are,
Operators In Python Programming
Arithmetic operators perform functions like addiction, subtraction, multiplication, division, etc.
The comparison operator is associated with a comparison of operands like one is greater than the other or less than or equal, not equal, etc.
- Assignment operators are the ones that assign values, like the equal to (=) sign. There are more assignment operators too.
- Logical operators are where the condition or logical expression is tested whether one logical expression and the other logical expression is true or not.
- The bitwise operators are those, when the operation is done on the bits of a certain expression.
- Membership operator is the one which is usually found or say used along with either say a list object or a dictionary object or say sequential ones.
- Identity operators are again treated upon the sequential basis and is very similar to membership operators.
Now the most common ones are arithmetic operators, assignment operators,
Arithmetic Operators in Python
Operator | Description | Example |
+ | Adds two operands or unary plus | x+y , 2 |
– | Subtracts right operand from left or unary minus | x-y , -2 |
* | Multiplies two operands | x*y |
/ | Divides left operand by right | x/y |
// | Floor division – division that results into whole number adjusted to the left in the number line | x//y |
Bitwise operator in Python
Operator | Description | Example |
& | Bitwise AND | x&y |
| | Bitwise OR | x|y |
^ | Bitwise XOR | ~x |
~ | Bitwise NOT | x^y |
<< | Bitwise Left shift | x<<2 |
>> | Bitwise Right shift | x>>2 |
Logical operators
Operator | Meaning | Example |
and | True if both operands are true | x and y |
not | True if operand is false | not x |