Python operators are symbols or keywords used to perform operations on values and variables. They help programmers perform calculations, compare values, make decisions, and manipulate data.
Press enter or click to view image in full size
Get Karthikanivas’s stories in your inbox
Join Medium for free to get updates from this writer.
Types of Python Operators
Arithmetic Operators Used for mathematical calculations such as addition, subtraction, multiplication, division, modulus, and exponentiation.
Comparison Operators Used to compare two values. They return either True or False. Examples include greater than, less than, equal to, and not equal to.
Logical Operators Used to combine multiple conditions. The main logical operators are AND, OR, and NOT.
Assignment Operators Used to assign values to variables and update their values. Examples include =, +=, -=, and *=.
Membership Operators Used to check whether a particular value exists in a sequence or collection. The main operators are in and not in.
Identity Operators Used to check whether two variables refer to the same object. The main operators are is and is not.
Bitwise Operators Used to perform operations on binary numbers. They include AND, OR, XOR, NOT, left shift, and right shift.
In Short
Python operators make it easier to calculate, compare, assign, check, and manipulate data in Python programs.