What the difference between is and “==” in python

sanju saini
May 31, 2021

--

Today, in this article, We are going to understand the difference between “is” and “==”(Equal) operator

“is” operator related to identity operator. whereas “==”(Equal) operator is related to comparison operator

The Equal(“==”) operator compares the value of both the operands and checks for values equality. Whereas the ‘is’ operator checks whether both the operands refer to the same object or not.

For example:-

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

sanju saini
sanju saini

Written by sanju saini

Senior Software Engineer with 4.5+ years of experience in full-stack development, specializing in Python, Golang, PHP, Django, FastAPI, React, and RESTful APIs.

No responses yet

Write a response