Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
July 26, 2022 12:44 pm GMT

Operators in Python

1.Introduction
Operators are some unique symbols which are used to carry out various functions. They are predefined in Python.
NOTE-On which the operators are used are known as the operand.
For example-Image description

In the above example we have used + as a operator and a and b are the operand.
Image description
2.operators in Python are majorly classified into 5 different types
Image description

3.Arithmetic operator
It includes numeric values as we use in mathematics.
Image description
For example-Image description
output
Image description

4.Assignment operator
These operators are used to assign some data to any unknown variables.
Image description
For example-Image description
output
Image description
`5.Logical operator
These operator are used to combine two or more statements.
Image description
For example-Image description
output
Image description

6.Comparison operator
This kind of operators are used to compare two statements.
They gives us the output in TRUE or FALSE .
Image description
For example-Image description
output
Image description
example-Image description
output
Image description

7.Identify operators
These operators are used to compare the variables if both the statements contain same kind of data in them.
Image description
For example 1 -Image description
output
Image description
2.Image description
output
Image description


Original Link: https://dev.to/jindalkeshav82/operators-in-python-4ee5

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To