Sunday, October 27, 2019

Python Operators

Below is the summary

There are various methods for arithmetic calculation in Python as you can use the eval function, declare variable & calculate, or call functions
Comparison operators often referred as relational operators are used to compare the values on either side of them and determine the relation between them
Python assignment operators are simply to assign the value to variable
Python also allows you to use a compound assignment operator, in a complicated arithmetic calculation, where you can assign the result of one operand to the other
For AND operator – It returns TRUE if both the operands (right side and left side) are true
For OR operator- It returns TRUE if either of the operand (right side or left side) is true
For NOT operator- returns TRUE if operand is false
There are two membership operators that are used in Python. (in, not in).
It gives the result based on the variable present in specified sequence or string
The two identify operators used in Python are (is, is not)
It returns true if two variables point the same object and false otherwise
Precedence operator can be useful when you have to set priority for which calculation need to be done first in a complex calculation.

References:
https://www.guru99.com/python-operators-complete-tutorial.html

No comments:

Post a Comment