“is” and “==” in Python

Sivasai Yadav Mudugandla
The Startup
Published in
4 min readAug 27, 2020

--

Speed up your string comparisons

Many programmers and beginners love python. Python is one of the languages that is witnessing incredible growth and popularity year by year.

In 2017, Stack overflow calculated that python would beat all other programming languages by 2020 as it has become the fastest-growing programming language in the world.
Python language is one of the most accessible programming languages available because of its Readability, tons of libraries, Vibrant Community, can be used for Web Programming, Desktop Applications, Big data, Cloud Computing, Machine Learning, and so on.

It’s very important for every Pythonista to understand the difference between == (equality operator ) and is ( identity operator ) before you use it.
But, many of us are confused about which one to use in which situation. Let’s understand it clearly.

In this article, I will discuss

  1. What is equality and identity operators
  2. When to use equality and identity operators
  3. Which one is best.

1. What is == and is operators

--

--

Sivasai Yadav Mudugandla
The Startup

Sr. Data Analyst at CITI Bank| London | Ex — Data scientist | Post Graduate in AI & ML | Pythonista | https://www.linkedin.com/in/sivasai-mudugandla-89a156104/