Python Operators
This article is the 8th part of this article series Python. In this article am going to talk about several types of python operators. We will go through related operations, functioning. Python Operators won’t create any issue for those who code and for those who just get started, I tried to keep it as simple and interactive as I can. However, if anyone faces any doubt then guys don’t forget to ping us back.
So let’s explore it..
Getting Theme
For getting the theme of Python, kindly go through my previous article:
Chapter 1  Python Properties
Chapter 2  Python VS Other Languages
Chapter 3  Environment and Setups
Chapter 4  Python Basics 1.1
Chapter 5  Python Basics 1.2
Chapter 6  Python Strings
Chapter 7  Python Lists
Chapter 8  Python Operators…
Chapter 9  Python Decision Making
Chapter 10  Python Looping
Chapter 11  Python Loop Control Statements
Chapter 12  Python Tuples
Chapter 13  Python Tuple Operations
Chapter 14  Python Builtin Tuple Functions
Chapter 15  Python Dictionary
Chapter 16  Python Dictionary Operations
Chapter 17  Python Function
Chapter 18  Python Function Calling Arguments
Chapter 19  Python Anonymous Function
Chapter 20  Python Builtin Anonymous Function
Python Operators
In this article I’ll take you through the types of Python Operators and their use..
 Arithmetic Operators
 Special Operators
 Comparison Operators
 Bitwise Operators
 Assignment Operators
 Identity Operators
Arithmetic Operators
For performing the base mathematical operations or some other type of mathrelated functionality, we do use Arithmetic Operators.
Let’s take a close look at all these operators.
Operator 
Description 
Example 
Addition 
Adds both operands together. 
z = x + y 
Subtraction 
Subtracts Right side operand from left side operand. 
z = x – y 
Multiplication 
Multiplies both operands together. 
z = x * y 
Division 
Divides left side operand with right side operand. 
z = x / y 
Modulus 
It take modulus using two operands and assign the result to left. 
z = x % y 
Flow Chart  Arithmetic Operators
Here’s a flow chart that demonstrate how operational flow goes let’s have a close look at this..
(If you need examples for every operator then let me know I’ll update it.)
Special Operators
Actually, these are not special operators, these are subset of mathematical operators, that performs the same functionality as general mathematical operators do.
Let’s take a close look at all these operators..
Operator 
Description  Example 
Exponent 
Performs exponential operations. 
x ** y = x ^ y 
Floor Division  Takes result of quotient and rejects mantissa. 
5 // 2 = 2 
(If you need examples for every operator then let me know I’ll update it.)
Comparison Operators
The comparison operators are used to compare the values both side of the operators and performs specific operations based on them.
Let’s take a close look at all these operators..
Operator  Description 
Example 
== 
Compares both left and right operands and according to the result displays either True or False 
(2 == 3) false 
>  Compares left operand with right operand and according to the result(greater) displays either True or False. 
(3 > 2) 
< 
Compares left operand with right operand and according to the result(left) displays either True or False.  (3 < 2) true 
!= 
If values of two operands aren’t equal, then displays condition accordingly. 
(3 != 2) 
<> 
If the values of both operands aren’t equal then condition becomes true. 
(3 <> 2) 
>= 
If the value of left operand is greater than the right side operand, then condition becomes true. 
(3 >= 2) 
<=  If the value of left operand is greater than the right side operand, then condition becomes true. 
(3 <= 2) 
Flow Chart  Comparision Operators
Here’s a flow chart that demonstrate how operational flow goes let’s have a close look at this..
(If you need examples for every operator then let me know I’ll update it.)
Bitwise Operators
Bitwise operators are bitoriented operators. Here bit oriented means that these operators work on the bits and performs the action bit by bit.
Let’s take a close look at all these operators..
Operators 
Description  Example 
& (Binary AND) 
It copies a bit to the result if it exists in both operands. 
(x & y) 
 (Binary OR) 
It copies a bit if it exists in either operand. 
(x  y) 
~ (Binary Ones Complement) 
It’s used for flipping bits. 
(~x) 
^ (Binary XOR) 
It copies the bit if it is set in one operand but not both 
(x ^ y) 
<< 
It shifts the value to the left specified by the right operand 
x << 2

>> (Binary Right Shift) 
It shifts the value to the right specified by the right operand 
x >> 3 
Flow Chart  Bitwise Operators
Here’s a flow chart that demonstrate how operational flow goes let’s have a close look at this..
(If you need examples for every operator then let me know I’ll update it.)
Assignment Operators
As the name suggests, assignment operators are used for assigning values, for example to any variable while performing a certain operation.
Let’s take a close look at all these operators..
Operators 
Description  Example 
= 
It assigns value from Right side operand to left side. 
z = x + y 
+= Add AND 
It adds Right operand to the left operand and assigns result to left operand. 
z += x 
= Subtract AND 
It subtracts Right operand to the left operand and assigns result to left operand. 
z = x 
*= 
It multiplies Right operand with left operand and assigns result to left operand. 
z *= x 
/= 
It divides left operand with right operand and assigns result to left operand. 
z /= x 
%= 
It takes modulus using two operands and assigns result to left operand. 
z %= x 
Flow Chart  Assignment Operators
Here’s a flow chart that demonstrate how operational flow goes let’s have a close look at this..
(If you need examples for every operator then let me know I’ll update it.)
Identity Operators
Identity operators are used to compare the memory locations of two objects. (compare the locations)
Let’s take a close look at all these operators..
Operator  Description 
Example 
Is

Evaluates whether the values at either side are equal or not and acts(true) accordingly. 
If x is y 
Is NOT

Evaluates whether the values at either side are equal or not and acts(false) accordingly. 
If x is not y 
Flow Chart  Identity Operators
Here’s a flow chart that demonstrate how operational flow goes let’s have a close look at this..
(If you need examples for every operator then let me know I’ll update it.)
Guidelines from our Side
 Do as much as code you can.
 Code anything you want, the best way to learn.
 Don’t just study things, try to learn them.
 Work on your Concepts.
 Work on the fundamentals of any technology or stuff you want to learn.
Moto
“Keep calm and code python”.
I tried to make it interesting and interactive article and wish you guys going to like that. Meanwhile, if you have any suggestions then your welcome.
Till the next part, Keep Sharing & Tweaking! 🙂
Nicely represented and very clear. Keep posting more.
Hey, thanks for your kind response and yes we’ll keep updating you. 🙂
Appreciating the time and energy you put into your website and detailed information you present. It’s good to come across a blog every once in a while that isn’t the same unwanted rehashed material. Excellent read! I’ve bookmarked your site and I’m adding your RSS feeds to my Google account.
Hey, thank you for your kind words. Keep suggesting and writing back to us and let us know whatelse you would like to see here. It’s always good to get some responses and feedbacks from our users. Cheers! 🙂
Greetings! Very useful advice in this particular article! It’s the little changes that make the most significant changes. Thanks a lot for sharing!
Hey, glad to hear that. Kindly, go through some other tech updates and posts, you gonna like them for sure. Keep spreading the words. Cheers! 🙂
Hello i am Mitchel, its my first occasion to commenting anywhere, when i read this piece of writing i thought
i could also make comment due to this sensible article.
Hey, glad to hear that. Keep visiting us for more refreshing stuff. Cheers! 🙂
I truly enjoy examining on this website, it has good posts.
Hey, thanks for your kind words. Keep visiting. Cheers! 🙂
Great post. Thanks for the read.
Good day! I really desire to offer you a big thumbs up for
the excellent information you possess got here on this post.
I will be returning to your online site for further soon.
You are a very clever person!
Very energetic post, I loved that bit. Will there be a part 2?
you’re really a good webmaster. The web site loading velocity is amazing. It kind of feels that you’re doing any unique trick. Moreover, The contents are masterpiece. you’ve performed a fantastic task in this topic!
Wonderful work! That may be the level of info that should be shared all over the net.
Hi there! This post couldn’t be written far better! Taking a look at this article reminds me of my previous roommate! He always kept preaching about this. I will send this post to him. Fairly certain he’ll use a great read. Many thanks for sharing!