Today we will read about python operators in this post and if we know about its types, then let’s start: –
operator is a symbol that represents an operation. And the values at which operators operate are called operands. Operators are used to manipulate data and variables in a program.
That is, operators are symbols that are used to perform mathematical or logical operations in a program.
Arithmetic Sign Description
Addition + Adds the left and right operand.
Subtraction – subtracts left operand from right operand.
Multiplication * Multiply left and right operand.
Division / Divides right operand from left operand.
Modulus % The remainder returns by dividing the right operand from the left operand.
Floor Division // Floor value returns by dividing right operand from left operand.
Exponent ** The power of left operand is right operand.
Relational Operator Sign Description
Equal to == If two operands are equal then it returns true.
Not Equal to != If two operands are not equal then it returns true.
Less than < True returns when the left operand is smaller than the right operand.
Greater than > True returns when left operand is greater than right operand.
Less than or Equal to <= True returns when the left operand is smaller than or equal to the right operand.
Greater than or Equal to >= True returns when the left operand is greater than or equal to the right operand.
Logical Operator Sign Description
Logical AND and If two conditions are true then it returns true.
Logical OR or If one of the two conditions is true then it returns true.
Logical NOT not This operator turns false to true or true to false.