Python supports different types of operators, which is like that –
These are used with a numeric value to calculate mathematical calculations.
Here some arithmetic operators which used in python mathematical calculations.
+(addition), -(subtraction), *(multiplication), /(division), etc.
How we can use it?
Anyone can we use it using simple syntax -
>>> a = 5
>>> b = 6
>>> c = a+b
Python support large number of assignment Operator here we choose-
=, +=, -=, *=, /=, etc
x = "hi"
It is used to compare two variables
Here list of comparison variables are –
==, >=, <=, >, <, !=, etc
x = 2
y = 2
print(x == y)
Logical Operator basically performs upon the conditional operator, here some logical operator which used in python.
and, or, not
x = 9
print(x > 2 and x < 11)
And Many other operators, like bitwise operators, etc. which used to perform upon python.
I hope it may be helpful to work with python operators, in the next tutorial we will learn how to implement lists in python